نمونه کد دیگری برای فراخوانی Stored Procedure در سیشارپ (Select)
چهارشنبه, ۱۲ آبان ۱۳۹۵، ۱۰:۴۶ ق.ظ
DataTable dt;
SqlConnection conn = new SqlConnection(_ConnectionString);
SqlCommand cmd_Report = new SqlCommand();
SqlDataAdapter adp_Report = new SqlDataAdapter();
cmd_Report.CommandText = "stp_SelectStudent";
cmd_Report.CommandType = CommandType.StoredProcedure;
cmd_Report.Connection = conn;
adp_Report.SelectCommand = cmd_Report;
dt = new DataTable();
adp_Report.Fill(dt);
dataGridView1.DataSource = dt;
۹۵/۰۸/۱۲