Sponsored Links
VB.NET 2005 Tutorials
- VB.NET 2005 Free Training
- Shared Assembly
- The .NET Framework Architecture Part 1
- Tracing VB.NET Windows Application
- The .NET Framework Architecture Part 2
- VB.NET Windows Application Testing
- Implementing Inheritance
- The File Types Editor
- Visual Studio.NET Namespaces
- Differences between VB.NET 1.0 and VB.NET 2.0
- Visual Studio Windows Forms Designer
- Introducing VB.NET Windows Forms
- Event Handling In Visual Basic .NET
- Exploring the Forms Designer generated code
- Building Graphical Interface elements
- Microsoft .NET Creating Installation Components
- Application Class and Message Class
- Visual Studio Adding Controls to Windows Form
- Common Controls and Handling Control Events
- Implementing Class Library Object
Tutorials
VB.NET 2005.NET Complex Data Binding
.NET Complex Data Binding
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





Next Page: .NET Complex Data Binding - Page 2
Comments
renu said:
| how to place data from datagridview from one form and acess the same row in other form textbox's.. |
Sponsored Links
