Q:

Data Table transfer to Model then to the view

Ok so after alot of research i have concluded that passing a data table to a view is a bad idea ,so how do i pass my data table to a Model and then be able to access each row and column  in the view?Sorry i am new to MVC
I start with a simple SQL statement
StringBuilder sbSQL = new StringBuilder();
        //// define a list of CustomerModel objects
        DataSet tempDS = new DataSet();

        //string xSQL = "SELECT PropertyAddress,PropertyTypeDesc,PropertyID FROM KDOR_vwPropertyGeneral ORDER BY PropertyAddress";
        System.Data.SqlClient.SqlDataAdapter DbCmd = new System.Data.SqlClient.SqlDataAdapter();
        string sqlWhereCont = " WHERE ";
        sbSQL.Append("SELECT ");
        sbSQL.Append("PropertyAddress As PropertyAddress,");
        sbSQL.Append("PropertyTypeDesc As PropertyTypeDesc,");
        sbSQL.Append("PropertyID as PropertyID");
        sbSQL.Append(" FROM [KDOR_vwPropertyGeneral] ");
        if (!string.IsNullOrEmpty(user.Address))
        {
            sbSQL.Append(sqlWhereCont + "(PropertyAddress) LIKE '" + user.Address + "%'");
            sqlWhereCont = "AND ";
        }
        sbSQL.Append(" ORDER BY ");
        sbSQL.Append(" PropertyAddress ");

        string MyConnectionString = ConfigurationManager.ConnectionStrings["WLConnection"].ConnectionString;
        System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection(MyConnectionString);
        System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sbSQL.ToString(), cnn);
        cmd.CommandTimeout = 30000;
        DbCmd.SelectCommand = cmd;

move the data to a DataSet and Data Table 
DbCmd.Fill(tempDS, "ResultSet");
        DataTable resultSet = tempDS.Tables["ResultSet"];

Add items to Model
 var vm = new List<BedroomModel>();
        foreach (DataRow dr in tempDS.Tables[0].Rows)
        {
            vm.Add(new BedroomModel {PropertyAdd  = dr.ItemArray[0].ToString() });
            vm.Add(new BedroomModel { PropertyDesc = dr.ItemArray[1].ToString() });
            vm.Add(new BedroomModel { PropertyID = dr.ItemArray[2].ToString() });
        }

Now how to i Access each Item and loop through them in a view? Cause i get an error here is a look at my view 
@model DataBaseTest.Models.BedroomModel

@{
ViewBag.Title = "Result";
}

 <h2>Result</h2>
@{
ViewBag.Title = "Result";
}

<table border ="1">
<thead>
  @*  <tr>
    @foreach (var col in Model.Columns) {
        <th>
            @col.ColumnName
        </th>
    }
    </tr>*@
    <tr>
        <th>Property Address</th>
        <th>Property Description</th>
        <th>Property ID</th>
    </tr>
</thead>

<tbody>

@foreach (var item in Model.PropertyAdd)
 {         
  <tr>

      <td>@Model.PropertyAdd</td> 

  </tr> 
  }     
 </tbody>

Model
namespace DataBaseTest.Models
  {
  public class BedroomModel
    {
      public string Address { get; set; }
      public string PropertyAdd { get; set; }
      public string PropertyID { get; set; }
      public string PropertyDesc { get; set; }

       public IEnumerable<BedroomModel> BedroomModels { get; set; }
    }

}
Again Sorry i am new to MVC
Any advice Would be Greatly Appreciated.

A:

You are telling your view that it should look for a single BedroomModel object, when you actually want to pass it a List<BedroomModel> object. 
@model List<DataBaseTest.Models.BedroomModel>

As a result, your Model property will be the list itself, so your foreach loop only needs to loop through the Model, not Model.BedroomModels.
@foreach (var item in Model)
{         
    <tr>
        <td>@item.PropertyAdd</td>
        <td>@item.PropertyDesc</td>
        <td>@item.PropertyID</td>
    </tr> 
}  

Because of this change, you can remove the BedroomModels property from your BedroomModel class.
public class BedroomModel
{
  public string Address { get; set; }
  public string PropertyAdd { get; set; }
  public string PropertyID { get; set; }
  public string PropertyDesc { get; set; }
}

That would fix your problem, but I also noticed that when populating your vm list, you are adding three items into the List, where you should only be adding one BedroomModel object. Your foreach loop should look like this:
var vm = new List<BedroomModel>();
foreach (DataRow dr in tempDS.Tables[0].Rows)
{
    vm.Add(new BedroomModel 
    {
        PropertyAdd  = dr.ItemArray[0].ToString(),
        PropertyDesc = dr.ItemArray[1].ToString(),
        PropertyID = dr.ItemArray[2].ToString()
    };
}

You must also make sure that you are sending the ViewModel into the View. Your Action should return:
return View(vm);

