Exforsys

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor

Ads


Home arrow Technical Training arrow VB.NET 2005

.NET Data Form Wizard Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 9th Jul 2005    |   Last Updated on: 24th Dec 2007

.NET Data Form Wizard

.

.

Ads

Filtering Data

Filtering and sorting data is one of the most needed activity in the constructing any solution. We have so far seen data being pulled out from the table and displayed using some controls. However we have added an additional facility to navigate through the data. The usefulness of these techniques are limited if we cannot display data which are filtered and sorted. The data filtering can be done at the Server or at the application level with the dataset. Both the methods are discussed below:

.

.

Filtering With DataViews

The moment we use the DataAdapter’s fill method to populate the DataSet, we are dealing with disconnected architecture and the DataSet can be used to create DataViews. All further activities can be performed at the DataView level. This does not affect the data at the backend. This is the least network intensive and gives quicker response. The following illustration explores the process of filtering with DataViews

Click here to vew sample code

.Filtering At the Server

In some cases the user may still want to filter the data from the server and deal with the active data at all time. In such a scenario the application will be highly network hungry. But this method is useful if the user need dynamic data. Let us illustrate server side filtering :

Transforming Data with Lookups

Sometimes it is useful to display data in a user-friendly format on a Windows Form but store the data in a format that is more meaningful to the user’s program. For example, an order form for food might display the menu items by name in a list box. But the data table recording the order would contain the unique ID numbers representing the food. The user might have two tables like this:

OrderID

ItemID

Quantity

4085

12

1

4086

13

3


.
.



ID

Name

12

Potato

13

Chicken


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 




 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Property

Setting

DataSource

The table that contains information about which ID number is equivalent to which item. In the above scenario, this is ItemTable.

DisplayMember

The column of the data source table that the user wishes to display in the control. In the above scenario, this is "Name" (to set in code, use quotation marks).

ValueMember

The column of the data source table that contains the stored information. In the above scenario, this is "ID" (to set in code, use quotation marks).

.

.

 

5. In a procedure, call the System.Windows.Forms.ControlBindingsCollection.Add method of the ControlBindingsCollection class to bind the control's System.Windows.Forms.ListControl.SelectedValue property to the table recording the form input. The user can also do this in the designer instead of in code, by accessing the control's System.Windows.Forms.Control.DataBindings property in the Properties window. In the above scenario, this is OrderDetailsTable, and the column is "ItemID".

.

Master Detail

.

Creating the Master detail form is also simple using a wizard. In this case the user creates a new project and adds a database connection and also a DatasSource. After this he selects two tables that have foreign key relationships. Then he creates data sets also by binding the parent file to Grid. He then finished by adding a BindingNavigator and seting it’s dataSource property to emergency.

.

Ads

..

...

.

The following screenshot shows the output of a master detail Form we just created.

.

 

.


 

 

 

 

 

 

In this lesson we have learnt all about Data binding and filtering of data. In the lesson that follows we shall be focusing upon Consuming and Manipulating Data that we have bound to the controls.

4. Set the following properties. They can be set in code or in the designer.

3. Establish a data relation between the two tables. For more information, see Introduction to DataRelation Objects.

2. Connect to the user’s data source.

 

1. Add a System.Windows.Forms.ComboBox, System.Windows.Forms.ListBox, or System.Windows.Forms.CheckedListBox control to the form.

To create a lookup table

In this scenario, one table, OrderDetailsTable, stores the actual information we are concerned with displaying and saving. But to save space, it does so in a fairly cryptic fashion. The other table, ItemTable, contains only appearance-related information about which ID number is equivalent to which food name, and nothing about the actual food orders.



 
This tutorial is part of a VB.NET 2005 tutorial series. Read it from the beginning and learn yourself.

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor
 

Comments