The ADO.Net DataSet Object Part 1
- Date: 2007-01-25 - Word Count: 792
Share This!
The DataSet is an in-memory database – a collection of virtual tables with means to populate, examine, modify and deleting delete the tables and the data within them. You can also define and manipulate the relationships between the tables and tables, create and enforce constraints to maintain those relationships. Surprisingly, the data that populates the tables within a DataSet can and frequently does come from different data sources, leading to very powerful flexibility in connecting and maintaining data in various server sources.
The primary purpose of a DataSet is to allow the user to operate on data from a server in a disconnected mode. The temporary separation of data from the server is a desirable thing because it frees memory on the server, as well as connection and network resources. The DataSet allows data to be ‘borrowed’ from the server in relatively small usable chunks. The DataSet then ‘manages’ the connection between the data and allows the user to edit, update, delete, append, or select portions of that data.
The DataSet is first and foremost a collection of table objects. These table objects can be imported from various and diverse data sources such as SQL Server, Oracle, XML files, and the like, or they can be entered programmatically or through a convenient User Interface (UI) and then added to the DataSet programmatically. The most useful methods are to Accept Changes, AcceptChanges, RejectChanges, Merge, Clone, a few functions for reading and writing XML and XML schema, and – most important of all- the GetChanges method, which gets a DataSet which contains all of the data changes made to the current one since it was loaded.
The table objects look like tables in a regular database, though they are virtual tables, which reside only in memory. The table objects have collections of DataColumns, DataRows, Constraints, DataRelations, Property Collections, DataRowView, and a PrimaryKey, which may be a collection of DataColumns.
DataTable Class Members
Constructors
Visibility
Constructor
Parameters
public
DataTable
( )
public
DataTable
( String tableName )
Properties
Visibility
Name
Value Type
Accessibility
public
CaseSensitive
Boolean
[ Get , Set ]
public
ChildRelations
DataRelationCollection
[ Get ]
public
Columns
DataColumnCollection
[ Get ]
public
Constraints
ConstraintCollection
[ Get ]
public
Container
IContainer
[ Get ]
public
DataSet
DataSet
[ Get ]
public
DefaultView
DataView
[ Get ]
public
DesignMode
Boolean
[ Get ]
public
DisplayExpression
String
[ Get , Set ]
public
ExtendedProperties
PropertyCollection
[ Get ]
public
HasErrors
Boolean
[ Get ]
public
Locale
CultureInfo
[ Get , Set ]
public
MinimumCapacity
Int32
[ Get , Set ]
public
Namespace
String
[ Get , Set ]
public
ParentRelations
DataRelationCollection
[ Get ]
public
Prefix
String
[ Get , Set ]
public
PrimaryKey
DataColumn
[ Get , Set ]
public
Rows
DataRowCollection
[ Get ]
public
Site
ISite
[ Get , Set ]
public
TableName
String
[ Get , Set ]
Methods
Visibility
Name
Parameters
Return Type
public
AcceptChanges
( )
Void
public
BeginInit
( )
Void
public
BeginLoadData
( )
Void
public
Clear
( )
Void
public
Clone
( )
DataTable
public
Compute
( String expression , String filter )
Object
public
Copy
( )
DataTable
public
EndInit
( )
Void
public
EndLoadData
( )
Void
public
GetChanges
( DataRowState rowStates )
DataTable
public
GetChanges
( )
DataTable
public
GetErrors
( )
DataRow
public
ImportRow
( DataRow row )
Void
public
LoadDataRow
( Object values , Boolean fAcceptChanges )
DataRow
public
NewRow
( )
DataRow
public
RejectChanges
( )
Void
public
Reset
( )
Void
public
Select
( String filterExpression , String sort , DataViewRowState recordStates )
DataRow
public
Select
( String filterExpression )
DataRow
public
Select
( )
DataRow
public
Select
( String filterExpression , String sort )
DataRow
public
ToString
( )
String
Events
Multicast
Name
Type
multicast
ColumnChanged
DataColumnChangeEventHandler
multicast
ColumnChanging
DataColumnChangeEventHandler
multicast
Disposed
EventHandler
multicast
RowChanged
DataRowChangeEventHandler
multicast
RowChanging
DataRowChangeEventHandler
multicast
RowDeleted
DataRowChangeEventHandler
multicast
RowDeleting
DataRowChangeEventHandler
Rows are added programmatically using the DataRows object:
Dim dr as DataRow=tblEmployee.NewRow()
dr(“dcFirstName”)=”Elmer”
dr(“dcLastName”)=”Fudd”
tblEmployee.Rows.Add(dr)
Resources
Tutorial: ADO.NET Populate a DataSet from a Database
This tutorial discusses populating a DataSet from a Database.
Tutorial: DataSet Vs. DataReader
This is an interesting resource that discusses DataSet and Datareader.
The primary purpose of a DataSet is to allow the user to operate on data from a server in a disconnected mode. The temporary separation of data from the server is a desirable thing because it frees memory on the server, as well as connection and network resources. The DataSet allows data to be ‘borrowed’ from the server in relatively small usable chunks. The DataSet then ‘manages’ the connection between the data and allows the user to edit, update, delete, append, or select portions of that data.
The DataSet is first and foremost a collection of table objects. These table objects can be imported from various and diverse data sources such as SQL Server, Oracle, XML files, and the like, or they can be entered programmatically or through a convenient User Interface (UI) and then added to the DataSet programmatically. The most useful methods are to Accept Changes, AcceptChanges, RejectChanges, Merge, Clone, a few functions for reading and writing XML and XML schema, and – most important of all- the GetChanges method, which gets a DataSet which contains all of the data changes made to the current one since it was loaded.
The table objects look like tables in a regular database, though they are virtual tables, which reside only in memory. The table objects have collections of DataColumns, DataRows, Constraints, DataRelations, Property Collections, DataRowView, and a PrimaryKey, which may be a collection of DataColumns.
DataTable Class Members
Constructors
Visibility
Constructor
Parameters
public
DataTable
( )
public
DataTable
( String tableName )
Properties
Visibility
Name
Value Type
Accessibility
public
CaseSensitive
Boolean
[ Get , Set ]
public
ChildRelations
DataRelationCollection
[ Get ]
public
Columns
DataColumnCollection
[ Get ]
public
Constraints
ConstraintCollection
[ Get ]
public
Container
IContainer
[ Get ]
public
DataSet
DataSet
[ Get ]
public
DefaultView
DataView
[ Get ]
public
DesignMode
Boolean
[ Get ]
public
DisplayExpression
String
[ Get , Set ]
public
ExtendedProperties
PropertyCollection
[ Get ]
public
HasErrors
Boolean
[ Get ]
public
Locale
CultureInfo
[ Get , Set ]
public
MinimumCapacity
Int32
[ Get , Set ]
public
Namespace
String
[ Get , Set ]
public
ParentRelations
DataRelationCollection
[ Get ]
public
Prefix
String
[ Get , Set ]
public
PrimaryKey
DataColumn
[ Get , Set ]
public
Rows
DataRowCollection
[ Get ]
public
Site
ISite
[ Get , Set ]
public
TableName
String
[ Get , Set ]
Methods
Visibility
Name
Parameters
Return Type
public
AcceptChanges
( )
Void
public
BeginInit
( )
Void
public
BeginLoadData
( )
Void
public
Clear
( )
Void
public
Clone
( )
DataTable
public
Compute
( String expression , String filter )
Object
public
Copy
( )
DataTable
public
EndInit
( )
Void
public
EndLoadData
( )
Void
public
GetChanges
( DataRowState rowStates )
DataTable
public
GetChanges
( )
DataTable
public
GetErrors
( )
DataRow
public
ImportRow
( DataRow row )
Void
public
LoadDataRow
( Object values , Boolean fAcceptChanges )
DataRow
public
NewRow
( )
DataRow
public
RejectChanges
( )
Void
public
Reset
( )
Void
public
Select
( String filterExpression , String sort , DataViewRowState recordStates )
DataRow
public
Select
( String filterExpression )
DataRow
public
Select
( )
DataRow
public
Select
( String filterExpression , String sort )
DataRow
public
ToString
( )
String
Events
Multicast
Name
Type
multicast
ColumnChanged
DataColumnChangeEventHandler
multicast
ColumnChanging
DataColumnChangeEventHandler
multicast
Disposed
EventHandler
multicast
RowChanged
DataRowChangeEventHandler
multicast
RowChanging
DataRowChangeEventHandler
multicast
RowDeleted
DataRowChangeEventHandler
multicast
RowDeleting
DataRowChangeEventHandler
Rows are added programmatically using the DataRows object:
Dim dr as DataRow=tblEmployee.NewRow()
dr(“dcFirstName”)=”Elmer”
dr(“dcLastName”)=”Fudd”
tblEmployee.Rows.Add(dr)
Resources
Tutorial: ADO.NET Populate a DataSet from a Database
This tutorial discusses populating a DataSet from a Database.
Tutorial: DataSet Vs. DataReader
This is an interesting resource that discusses DataSet and Datareader.
Chris Kemp is a well knoen author who writes best quality articles on IT, Software, Programming, etc. For further details please visit the site www.paladn.com Your Article Search Directory : Find in Articles
Recent articles in this category:
- Web Development Projects - Developers Tools Tips
Open source usually refers to software that is released with source code under a license that ensur - A Guide to Cnc Kits
Building a CNC machine means that you would require a lot of tools, parts or different components. - Xlphoto Printing, the Best Choice for Banner Printing and Poster Printing
Suppose, you have visited a tourist spot or a hill station; over there, you have witnessed some of - Reliable Software Programming
Software reliability is an important facet of software quality. It is defined as "the probability - Designing an Ecommerce Site
In a recent article I talked about Google AdSense placement based on eye-tracking research. Howeve - Asp.net Development Benefits
Rightway solution has been keenly looking out for. Microsoft ASP.NET is a free technology that allo - Choosing Offshore Software Development Company
To turn into successful and gain the full benefits of software outsourcing, you require preferring - E-commerce and Web Portal Development in Vietnam
VIETNAM, owing to its superior intellectual capital has emerged as the ultimate destination for - Types of Softwares
Computer software is a general term used to describe a collection of computer programs, procedur - Offshore it Out Sourcing Consultancy in Vietnam
Vendors who provide Off shore IT Outsourcing Consultancy services are referred to as outsourcing
Most viewed articles in this category:
- Oracle Applications (Oracle E-Business Suite) Customizations: What is it?
Oracle recommends every company that installs Oracle Applications to avoid any customization, but I - Offshore Outsourcing: An All Win Premise
The awareness that outsourcing can boost productivity sans forfeit of class has impelled MNC’s - Oracle E-Business Suite vs. Microsoft Dynamics AX - Axapta: LATAM and Brazil
In this small article we will only concentrate on Microsoft Dynamics Axapta (and will not consider M - SAP Business One vs. Microsoft Dynamics GP - highlights for consultant
In this small article we will not make side-by-side technical specs comparison. We would rathe - Microsoft Great Plains - licensing and product versions
Current Microsoft Business Solutions Great Plains has more that 10 years of history. Former Gr - OCR Software - Optical Character Recognition or Optical Crud Recognition?
Optical Character Recognition (OCR) refers to a software technology and processes that involve the t - Microsoft Dynamics AX - Axapta - technical notes plus customization
Axapta or current name Microsoft Dynamics AX has one of the newest ERP design and architecture among - Microsoft Dynamics AX-GP-NAV-CRM: trends and international recommendations
Microsoft Great Plains/Microsoft Dynamics GP, Microsoft Navision (former Attain) Microsoft Dynamics - Microsoft Moves to Small Business Accounting/Retail Market - stakes and thoughts
In this small article we will be looking at the new opportunities for Microsoft Small Business Serve - Microsoft Axapta - Dynamics AX: Brazilian Portuguese version - consultant highlights
Axapta/Microsoft Dynamics AX short overview. Navision Axapta was designed by Navision Software