Than you call data adapter's Fill method.
If the dataset contains multiple tables, you should have separate data adapters for each table and must therefore fill each table separately.
SqlConnection con = new SqlConnection("connString");
SqlCommand com = new SqlCommand("exec your_stored_procedure", con);com.CommandTimeout = 30;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = com;
con.Open();
DataSet ds = new DataSet();
da.Fill(ds, "Data");
DataTable dt = ds.Tables[0];
con.Close();
Niciun comentariu:
Trimiteți un comentariu