DataReader in ADO.Net
I have a grid view in dot net, and want to show all record in gridview with the help of data reader.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Dec 4, 2012, 1:07 AM EST
Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Dec 4, 2012, 2:42 AM EST
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted Dec 4, 2012, 4:16 AM EST
SqlConnection con = new SqlConnection(constring);
SqlCommand cmd = new SqlCommand("_sp_GetEmployee", con);
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
IDataReader idr = cmd.ExecuteReader();
grdEmployee.DataSource = idr;
grdEmployee.DataBind();
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 4, 2012, 7:00 AM EST