Exforsys.com
 
Home Tutorials VB.NET 2005
 

Working with DataSets

 

Working with DataSets - Page 2

Page 2 of 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:





First Page: Working with DataSets


Read Next: Finding and Sorting Data in DataSets



 

 

Comments


Sami Khan said:

  Very good to Operate , please define also Binding_Context

Thanks
August 25, 2007, 3:48 am

DCunningham said:

  If I'm not mistaken...Binding_Context is the object that officially 'Binds' the modifications made to the dataset to the original data source.
May 16, 2009, 7:25 am

Post Your Comment:

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

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape