Anyone can help me to give link or website / tutorial about binding data with gridview ??....

Recommended Answers

All 2 Replies

Try this:

SqlConnection cn = new SqlConnection("Your ConnectionsString here");
        SqlCommand cmd = new SqlCommand("Query to Retrieve data from database",cn);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds, "Data");

        
        gridview.DataSource = ds.Tables[0];
        gridview.DataBind();

define the variables globally if u want to use them more thn once.

already try the code,

very simple and it work the way i wanted, Thanks love_dude1984.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.