title: Load values from Entity Framework into textboxes
body: <p>I am writing a wpf application which pulls data from a sql db.</p>
  
  <p>Currently I'm using the following code to populate a couple of text fields in my Window.</p>
  
  <p>I would like to change this to get the data from the Entity Framework model (which I have implemented) instead of filling a dataset from a stored procedure first.</p>
  
  <pre><code>    // Initialize a new Data Set object
      DataSet dts = new DataSet();
      DataTable dt = new DataTable();
  
      // Call the DataManager Class which will collect the data and fill the dataset
      DataManager.SelectConsHead(dts);
  
      dt = dts.Tables[0];
  
      // Set the source of the listview
      foreach(DataRow drr in dt.Rows)
      {
          txtAccount.Text = drr["Consignee"].ToString();
          txtAccount_Printed.Text = drr["Consignee_Printed"].ToString();
          txtPostalAdd1.Text = drr["Postal_Add1"].ToString();
          txtPostalAdd2.Text = drr["Postal_Add2"].ToString();
          txtPostalAdd3.Text = drr["Postal_Add3"].ToString();
          txtPostalAdd4.Text = drr["Postal_Add4"].ToString();
      }
  </code></pre>
  
  <p>}</p>