Free Training
C Language   |   CSS   |   MainFrame   |   VBScript   |   PHP   |   XML   |   C++ Tutorials   |   Ajax   |   JavaScript   |   CSS3   |   UML   |   jQuery   |   Microsoft AJAX

Sponsored Links

VB.NET 2005 Tutorials

 
Home Tutorials VB.NET 2005
 

.NET Complex Data Binding

 

.NET Complex Data Binding

Page 1 of 2

In this tutorial you will learn about Complex Data Binding, Binding to a ComboBox or ListBox, Binding to a DataGrid.



Complex Data Binding

Complex data binding is the ability of a control to bind to more than one data element, typically more than one record in a database, or to more than one of any other type of bindable data elements. Examples of controls that support complex binding are the DataGridView, ListBox, and ErrorProvider controls.


Binding to a ComboBox or ListBox

In this section let us create a complex binding by using a ComboBox and a ListBox. As in the preceding section the user must add a database connection to the project and to generate DataSets. Then he must proceed to create a new Windows Application Project by name ComplexDataBindingDemo. After creating the Data Connection to the SQLServer Database, from the ToolBox, he must drag and drop a DataGrid control and a list box on the form Form1. At this point the user’s window should look like the following screenshot:



Here also the user will have to go through all the steps involved to set up the data providers and also bind them to the control. After doing this the user will have to set the value to the DataSource property of the controls to the data set. Now in some controls like ListBox and ComboBoxes the user will come across two properties viz, display member and value member. In a typical situation he will be needing the descriptive value of the column to be displayed while the use of the values like ProductId etc need to be passed as values to further queries. The user will have to set these values also.


The following screenshots will show the output for ComplexBinding using a combo box, list box and a DataGrid.



Binding to a DataGrid

A DataGrid is a very useful Control. A number of improvements have been made to this control in .NET Framework 2005. Binding Data to DataGrid is simple. As a first step, The user has to set the value for the property Advanced Binding and DataSource.


1.2.3.4.5.


The following screenshot shows the final appearance of the DataGrid






Figure 4-11 The Data Component Configuration Wizard.


Next Page: .NET Complex Data Binding - Page 2


Read Next: .NET Data Form Wizard



 

 

Comments


renu said:

  how to place data from datagridview from one form and acess the same row in other form textbox's..
February 17, 2009, 2:25 pm

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links