i m begiener in asp .net and i want to learn how to reterive data from data base usin asp.net
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hussain AhmedPosted Jun 5, 2014, 3:57 AM
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();
Areeb QuaziPosted Jun 5, 2014, 3:51 AM