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:
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
Default.aspx.cs file:
Output:
0 comments:
Post a Comment