Академический Документы
Профессиональный Документы
Культура Документы
NET ARCHITECTURE:
Key components :
Dataset
Data Provider
Dataset handles data access. Data Manipulation is taken care by .Net data
provider.
DATASET:
It is an in-memory representation of data. It can be used with multiple and
differing data sources such as XML file or stream, data local to application.
Dataset can be used if an application meets any of the following requirement:
1
DATA PROVIDER:
Connection
Command
Data adapter
Data Reader
CONNECTION OBJECT:
OLEDB Connection works with almost all datasource SQL Connection Object
specifically works with Microsoft SQL Server 7.0 or later.
Connection String:
State Property:
COMMAND OBJECT:
Data from data source is obtained by executing commands using command
objects.
2
Property of Command Object:
Command Text Property:
Execute Scalar:
Performs query commands that return a single value. For example, counting the
number of records in a table.
Executes commands that returns the number of rows affected by the command.
Execute Reader:
DATA ADAPTER:
It acts as a bridge between data source and data set to retrieve data and
reconciles data back to the database. Oledb data adapter works with Oledb
provider. Sql data adapter which is specific to Sql Server is faster than Oledb
data adapter because it need not go through Oledb layer.
It exchanges data between single data source and single data table object in the
data set. To work with multiple tables in dataset multiple data adapter should
be used. To populate a table in dataset, data adapter can be called which
execute Sql Statement or Stored Procedure. Data Adapter supports Select
Command, Insert Command, Update Command and Delete Command
Properties.
DATA READER:
Data Reader can be used to increase the performance of the application which
works in read-only, forward-only mode.
3
DATA TABLE , COLUMN , ROW
In addition to a schema, a DataTable must also have rows to contain and order
data. The DataRow class represents the actual data contained in a table. You
use the DataRow and its properties and methods to retrieve, evaluate, and
manipulate the data in a table. As you access and change the data within a row,
the DataRow object maintains both its current and original state.
DATA VIEW
A DataView provides you with a dynamic view of a single set of data, much
like a database view, to which you can apply different sorting and filtering
criteria. Unlike a database view, however, a DataView cannot be treated as a
4
table and cannot provide a view of joined tables. You also cannot exclude
columns that exist in the source table, nor can you append columns, such as
computational columns, that do not exist in the source table.
You can use a DataViewManager to manage view settings for all the tables in a
DataSet. The DataViewManager provides you with a convenient way to
manage default view settings for each table. When binding a control to more
than one table of a DataSet, binding to a DataViewManager is the ideal
choice.
DATA RELATION
Relationships are created between matching columns in the parent and child
tables. That is, the DataType value for both columns must be identical.
Relationships can also cascade various changes from the parent DataRow to its
child rows. To control how values are changed in child rows, add a
ForeignKeyConstraint to the ConstraintCollection of the DataTable object.
The ConstraintCollection determines what action to take when a value in a
parent table is deleted or updated.