public void RunProc(string procName, out SqlDataReader dataReader)
{
SqlCommand cmd = CreateCommand(procName, null);
dataReader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
}
public SqlDataReader GetList(string prodid)
{
SqlDataReader dataReader = null;
try
{
// create data object and params
Database data = new Database();
SqlParameter[] prams = { data.MakeInParam("@prodid", SqlDbType.VarChar, 30,
prodid) };
// run the stored procedure
data.RunProc("Get_List_sp", prams, out dataReader);
}
catch (Exception ex)
{
Error.Log(ex.ToString());
}
return dataReader;
}dataReader;
}
SqlDataReader reader = null;
string prodid = Request.QueryString["product_id"];
reader = GetList(prodid);
..... bind controls