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

ADO.NET Object Model

Author : Exforsys Inc.     Published on: 11th Jul 2005    |   Last Updated on: 15th Jan 2009

In this tutorial you will learn about The ADO .NET Object Model, Data Providers and Their Objects and the Dataset Objects

Access and Manipulate Data - The ADO .NET Object Model

Ads

The ADO .NET Object Model

ADO .NET renders very good support for working with disconnected data. ADO .NET 2.0 comes with additional features that enhance the performance of common database tasks. The data source window provides a centralized window for creating and configuring related objects required to access a date source. Smart tags added to the controls provide fast access to common development tasks. However all the functionalities of the ADO .NET 1.1 have also not been discarded.

.

.

.

Data Providers and Their Objects

ADO .NET is offers a highly sophisticated system to support data centric application development. The data binding in Windows Forms enables users access data from databases as well as other structures like arrays and collections. Users can bind to a wide variety of structures, from simple arrays to complex data rows and views. However, any bindable structure must support IList interface. Any object that supports IList should be capable of being bound. We shall see some of the objects that provide data.

  • DataColumn object – This is the building block of the DataTable. A number of such objects make up a table. Each DataColumn object has a DataType property that determines the kind of data that the column is holding. A control can be bound simply such as a TextBox to a column within a data table
    .

  • Data Table – A DataTable object is the representation of a table, with rows and columns, in ADO .NET. A DataTable can be considered to a collection of two kinds viz., DataColumn objects and DataRows object. You can complex-bind a control to the information contained in a data table. Controls like DataGrid are used for this purpose
    .

  • DataView object – A DataView object is a customized view of a single data table that may be filtered or sorted. A data view is the data snapshot used by complex-bound controls. You can simple-bind or complex-bind to the data within the DataView. This is not an updating data source
    .

  • DataSet object – A DataSet is a collection of tables, relationships and constraints. You can simple-bind or complex bind to the data within the dataset.
    .

  • DataViewManager Object – A DataViewManager object is a customized view of the whole DataSet. It is an extended form of a DataView with realations included and with multiple tables.

The DataSet Objects

DataSets in ADO .NET are objects that store data in a memory cache, allowing access to the data even with the application disconnected from the databases. The structure of a System.Data.DataSet is similar to that of a relational database. It is organized in a hierarchical object mode of tables, rows, columns, constraints, and relationships.

A DataSet can be typed or untyped. Typed DataSets derive its table and column structure from a schema ( .XSD) file and is easier to program. Either a typed or untyped dataset can be used in applications. ADO .NET gives better support to typed datasets. A DataSet is located in System.Data NameSpace. DataSets are memory structures that do not contain any data by default. DataSets will have to be filled with data. This can be done in several ways.

1) If the DataSet was created using design-time tools, you can call the fill method of a TableAdapter. TableAdapters are created with a default Fill method but you can change the name.

2) By calling the Fill method of DataAdapter

3) Manually populate the DataSets by creating DataRow objects and call the AddNew method

4) Read an XML Document or stream into the dataset.

5) Copy the contents of one DataSet with another.

6) Copy the contents of one DataTable into a DataSet

A DataSet can store not only the data but also information about the data such as original, modified, inserted and deleted. Update of the underlying data-store is also possible. This can be done by calling the Update method of the TableDataAdapter or DataAdapter

A DataSet is typically a disconnected data-store. It does not support the idea of a current record. All the records in the DataSet are available at any time. You can access any row at any time directly. If the data is bound to one or more controls you can use the BindingNavigator to traverse the records. Some of the features of the DataSets that are based on XML.

1. The structure of a DataSet can be defined in an XML schema

2. You can generate a typed DataSet class using the schema information

3. You can read an XML document or stream into a DataSet using the ReadXml file method of DataSet and write to an XML file by calling the WriteXML method of DataSet.

4. You can create an XML view of the contents of a DataSet or DataTable.

Ads

Within a DataSet, table and column names are by default case insensitive. In contrast XML documents are case sensitive. The results of a data filter operation may return different data depending up on how the data is interpreted within the DataSet. You can have sufficient control over this by setting the DataSets CaseSensitive property. All tables in the dataset inherit the value of this property by default. This property can be overridden for each individual table by setting the tables CaseSensitive property.

A DataSet is not aware of any or all data relationships that exist in the database. The user can create DataRealtion objects that describe the relations between the tables in the DataSet. Objects of type UniqueConstraint, ForeignKeyConstraint are used to implement constraint.



 
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