Understanding Data Binding in ASP.NET

After creating the application and string the values in the database you need to exactly link or bind the data to its control. The data that is retrieved from the database has to be bound to a control so as to be displayed in a customized format. This process of binding is termed as data binding. There are two data binding concepts in ASP.NET to bind the data to the controls: Simple data binding and Complex data binding.


In simple data binding you have to bind a single value of the dataset to control such as a textbox control or a label control using the properties of the control. For example you can bind the value of the Name column in the dataset to a TextBox control by setting the Text property under the DataBindings category of the TextBox control. Complex data binding is the process of binding a component such as DataGrid and ListBox. This method, complex data binding, is used to display multiple values for a column from the dataset rows.

The only difference between simple data binding and complex data binding in ASP.NET is that simple data binding is mostly used to display a single value in the control, while complex data binding is used to display multiple values. The server-side controls that are most often used to bind data from a particular data source to your application are TextBox, ListBox, ComboBox, and DataGrid. Apart from TextBox control that is used in simple data binding, ListBox control, ComboBox control, and DataGrid control are used in complex data binding.

In ASP.NET while you add a data binding to an application in design time, Visual Studio .NET adds data binding expressions to the .aspx file. When you request application for the first time, the .aspx file gets compiled and executed. The data source that is bound to the control of an application ha a CurrencyManager object. This object is responsible to bind to the data source by keeping a pointer to the current item in the record list. This CurrencyManager object is in turn derived from BindingManagerBase class.


_______________________________________________________________________

Add to My Yahoo!


FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

Visit .NET Programming Tutorial Homepage

______________________________________________________

Recommended Resource


| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2017 - All Rights Reserved.