title: How to Populate a DataTable from a Stored Procedure
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1933855/how-can-i-retrieve-a-table-from-stored-procedure-to-a-datatable">How can i retrieve a table from stored procedure to a datatable</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to populate my datatable. I have created a datatable tmpABCD but i need to populate this with the values from a stored procedure. I am not able to proceed further.</p>
  
  <pre><code>SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["DB"].ConnectionString);
  sqlcon.Open();
  SqlCommand cmd = new SqlCommand("usp_GetABCD", sqlcon);
  
  DataTable dt = new DataTable("tmpABCD");
  
  dt.Columns.Add(new DataColumn("A"));
  dt.Columns.Add(new DataColumn("B"));
  dt.Columns.Add(new DataColumn("C"));
  dt.Columns.Add(new DataColumn("D"));
  </code></pre>