title: Use data in datatable to call stored procedures
body: <p>I have a datatable fetching values from a stored procedure written as below: </p>
  
  <pre><code>SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ConnectionString);
  sqlcon.Open();
  
  DataTable dt = new DataTable("tmp");
  DataSet ds = new DataSet();
  SqlDataAdapter da = new SqlDataAdapter();
  
  SqlCommand cmd = new SqlCommand("usp_abc", sqlcon);
  
  cmd.CommandType = CommandType.StoredProcedure;
  da.SelectCommand = cmd;
  
  da.Fill(dt);
  </code></pre>
  
  <p>Now, I need to loop through the datatable and get the values of this datatable and pass it is as a parameter to my stored proc.</p>