HI
i have 2 datalist in my page that use 2 procedure to fill data how i can use 2 datalist with 2 different procedure in my page i write these code in my page but occur error...
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection _cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["behtopConnectionString"].ConnectionString);
SqlCommand _cmd2 = new SqlCommand("house_1st", _cn);
SqlCommand _cmd3 = new SqlCommand("Clothing_1st", _cn);
_cmd2.CommandType = CommandType.StoredProcedure;
_cn.Open();
SqlDataReader _dr2 = _cmd2.ExecuteReader();
SqlDataReader _dr3 = _cmd3.ExecuteReader();
if (_dr2.HasRows)
{
HouseDL.DataSource = _dr2;
HouseDL.DataBind();
}
if (_dr3.HasRows)
{
DLClothing.DataSource = _dr3;
DLClothing.DataBind();
}
_cn.Close();
}