i m begiener in asp .net and i want to learn how to reterive data from data base usin asp.net
How 2 reterive dta using drop down
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Areeb Quazi96 reputationPosted Jun 4, 2014, 11:51 PM EDT
Hussain AhmedRank #1,271 · 1.4K reputationPosted Jun 4, 2014, 11:57 PM EDT
Retrive Data in Gridview ASP.NET c#
SqlConnection con=new SqlConnection("Data Source=AS1;Initial Catalog=practice;User ID=as");
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "SELECT * FROM tbl_bio";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();