I want to fill a DataGridView control using DataAdapter. But I don\'t know how to do it since I\'m using a stored procedure with parameter. Can someone cite an example pleas
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = ;
builder.UserID = ; //User id used to login into SQL
builder.Password = ; //password used to login into SQL
builder.InitialCatalog = ; //Name of Database
DataTable orderTable = new DataTable();
// stored procedute name which you want to exceute
using (var con = new SqlConnection(builder.ConnectionString))
using (SqlCommand cmd = new SqlCommand(, con))
using (var da = new SqlDataAdapter(cmd))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
//Data adapter(da) fills the data retuned from stored procedure
//into orderTable
da.Fill(orderTable);
}