title: How to show stored procedure values to datagridview
body: <p>I have the following stored procedure:</p>
  
  <pre><code>CREATE PROCEDURE abc
  AS
      SELECT CustomerID 
      FROM Customers 
      WHERE CustomerID &lt; 10
  
      SELECT GuarantorID 
      FROM Guarantors 
      WHERE GuarantorID &lt; 10
  </code></pre>
  
  <p>I have two columns in my datagridview. I want to show <code>CustomerID</code> in one column and <code>GuarantorID</code> in the second column</p>
  
  <p>My C# code does not show any value on datagridview</p>
  
  <pre><code>using (SqlConnection conn = new SqlConnection(connection))
  {
      using (SqlCommand cmd = new SqlCommand("dbo.abc", conn))
      {
          SqlDataAdapter sda = new SqlDataAdapter("abc",conn);
  
          sda.SelectCommand.CommandType = CommandType.StoredProcedure;
  
          DataTable dt = new DataTable();
          sda.Fill(dt);
  
          dataGridView1.DataSource = dt.DefaultView;                      
      }        
  }
  </code></pre>