0

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

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by diru
0

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.

0

already try the code,

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.