Tuesday 15 April 2014

what is data binding with gridview method in asp.net with example.

 GridView DataBind Method:
 
Use a DataBind () method to bind the data from the data source to the GridView control. This method solves all data binding expressions in the form of active control.
DataBind method is called automatically if the DataSourceID property of the GridView control element refers to a data source control is valid.

For DataBind following this steps: Default.aspx page


 Right Click  choose DataSource--> SqlDataSource1





Select DataBase name

Above snapshot show Connection string  this direct method of Binding data.

Default.aspx.cs file:

Output:


0 comments:

Post a Comment