will u please explain databinding in asp.net with a simple example?
will u please explain databinding in asp.net with a simple example?
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.
Suthish NairPosted Mar 10, 2011, 10:12 AM
Amit ChoudharyPosted Mar 8, 2011, 10:25 AM
and the binding in asp.net is done by assigning any collection that implements IEnumerator or IEnumerable interface. so its not necessary you need datatable everytime you can use ArrayList, List or any object.
After setting the datasource property we need to call the DataBind() method.
for e.g.,
Gridview1.DataSource = DataTable1;
GridView.DataBind();
After calling the DataBind() method a series of events executed to create the structure of GridView according to the DataSource.
These events are: RowDataBound, RowCreated etc.
Hope this short explanation will help you.
Thanks.
Please mark as answer if it helps you.
Vijay YadavPosted Mar 8, 2011, 5:08 AM
Read this as well..
Data Binding is binding controls to data from databases. With data binding we can bind a control to a particular column in a table from the database or we can bind the whole table to the data grid. Data binding provides simple, convenient, and powerful way to create a read/write link between the controls on a form and the data in their application.
ShankeyPosted Mar 8, 2011, 4:54 AM