DataSet Class in VB.net

By: Steven Holzner Emailed: 1727 times Printed: 2328 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

A dataset is a cache of data retrieved from a database, and, as we know, it's the major component of ADO.NET. A DataSet object is made up of a collection of DataTable objects that you can relate to each other using DataRelation objects. You also can guarantee data integrity with the UniqueConstraint and ForeignKeyConstraint objects.

A dataset reads and writes data and schema as XML documents, which can be transported using the HTTP protocol, which makes it great for the Internet. You can save the schema as an XML schema with the WriteXmlSchema method, and the schema and data can be saved using the WriteXml method. If you need to read an XML document that includes both schema and data, use the ReadXml method that infers and creates a schema from the document.

When the user edits data in data-bound controls (or when you change data values in code), changes are made to the dataset's data immediately. You can use the GetChanges method to get a new dataset holding only the rows that have changed, and you typically send this new dataset to the database in the data provider with the data adapter's Update method. The data provider may make changes itself in the dataset of changes you send it (such as updating fields that hold calculated values, or adding primary keys) and return a new dataset, which you can then merge into the dataset you're working with, using the dataset's Merge method. Then you use the AcceptChanges method on the original dataset to accept the changes (or use RejectChanges to cancel the changes). 

Datasets can be typed or untyped; usually, datasets are typed in Visual Basic. A typed dataset is a dataset that is derived from the DataSet class and uses information in an XML schema file (an XSD file). An untyped dataset, on the other hand, has no built-in schema. An untyped dataset can contain tables, columns, and rows, but those are exposed only as collections.

You also can easily navigate through a dataset that's been bound to controls


VB.net Home | All VB.net Tutorials | Latest VB.net Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Steven Holzner
Changes in Controls from VB6 to VB.net
Throwing a Custom Exception in VB.net
Throwing an Exception in VB.net
Using Finally in VB.net
Using Multiple Catch Statements in VB.net
Exception Filtering in the Catch Block in VB.net
Raising an Exception Intentionally in VB.net
Getting an Exception's Number and Description in VB.net
Using On Error GoTo 0 in VB.net
Using Resume Next and Resume Line in VB.net
Understanding Scope in VB.net
Properties in VB.net
Procedure Delegates in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net

More Tutorials in VB.net
Scope in VB.net
Unstructured Exception Handling in VB.net
Structured Exception Handling in VB.net
Creating Sub Procedures in VB.net
Creating Functions in VB.net
Passing a Variable Number of Arguments to Procedures in VB.net
Specifying Optional Arguments with default values in Procedures in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Procedure Delegates in VB.net
Properties in VB.net
Understanding Scope in VB.net
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net

More Latest News
Most Viewed Articles (in VB.net )
How to export from DataGridView to excel using VB.net
Your first VB.NET Crystal Reports - A step by step guide
Using Resume Next and Resume Line in VB.net
Preserving a Variable's Values between Procedure Calls in VB.net
Debug and Release Versions in .NET
The Option and Imports Statements in VB .NET
To read the entire worksheet in an Excel workbook through VB.net Code
Creating a Windows Service in VB.net
For Loop in VB.net
While Loop in VB.net
How to Open and Edit Cells in an Excel 2007 file in VB.NET
How to export from database to excel using VB.net
What's New in VB .NET? A comparison of VB vs VB.net
Assemblies, Solutions and Projects in VB .NET
Converting between Data Types in VB.net
Most Emailed Articles (in VB.net)
How to export from DataGridView to excel using VB.net
Creating List Views in Code using VB.net
Converting between Data Types in VB.net
Handling Strings in VB.net
For Each…Next Loop in VB.net
String equals, Copy to & Copy to in VB.net
String endswith, concat in VB.net
How to Open and Edit Cells in an Excel 2007 file in VB.NET
Read Data from Excel using OLEDB in VB.NET 2005
Chat Server in VB.net
OleDbConnection class in VB.net
OleDbDataAdapter class in VB.net
Creating a Windows Service in VB.net
Using the ServiceProcessInstaller Class in VB.net
Using the ServiceInstaller Class in VB.net