Understanding Data Binding in ASP.NETAfter 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.
|