alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow VB.NET 2005 arrow Working with DataSets
Site Search


Working with DataSets
Article Index
Working with DataSets
Page 2

.

.

Using Strongly Typed DataSets

A strongly typed DataSet can ensure that the CLR and .NET framework know at design time the type of data that is to be stored in the location specified by the DataSet. Unless a strongly typed data classes are set up, the compiler needs to take extra time at runtime to determine where to place the incoming data and how to convert it into the destination data type. The performance overhead is increased substantially relative to the strongly typed DataSets

Strongly typed DataSets can be created in two ways.

In the menu click the Data MainMenu and choose the submenu Add New Data Source …. And click on this. The Data Source Configuration Wizard opens. In the Wizard choose Database and click next.

In the second screen choose the data file (*.mdf) by clicking new connection and click next.

Click next to continue.

Choose the tables that you want to add and click on Finish. This will create a typed data set.

The screenshot shown below shows the new Strongly typed DataSet that was created.

In the next method, click the project in the solution explorer and choose the add new item from the context sensitive menu and in the dialog box choose the data set and click add.

The DataSet is created. The screenshot shows the toolbar with dataset tools. You can drag and drop any of the tools and configure. This also will create a typed dataset.

DataSets With Multiple Tables

In most situations a typical DataSet will be populated with multiple tables. By default these tables will not have any relationship defined. The user will also not have any constraints defined. Tables can be referenced by table name or serial number. For example a Customer table which was added as a third table can be referenced as under:

CustomerDataTable = MultiTableDataSet.Tables(3)

or by the following statement:

CustomerDataTable = MultiTableDataSet.Tables(“Customer”)

The following screenshot shows the structure of a DataSet with multiple tables:


Trackback(0)
Comments (1)add comment

Sami Khan said:

  Very good to Operate , please define also Binding_Context

Thanks
August 25, 2007

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape