Beruflich Dokumente
Kultur Dokumente
NET – part II
August 2004
[ Marmagna Desai]
CONTENTS
ADO vs ADO .NET
ADO .NET – Managed providers
Connecting to Database
SqlConnection
Selecting Database
SqlCommand
SqlDataReader
Inserting Data
SqlCommand
Datasets
Selecting Data
Updating Data
Conclusion
ADO vs ADO .net
Ultimate goal of ADO and ADO.net is
same: Providing data access API.
Recordsets are generated one per table. This does not support
hierarchical structure of data access. It will be programmer’s
responsibility to define relationships among different recordsets.
Rercordsets can not support data accessing from multiple sources.
Data Passing:
These classes are never used directly. The inherited set of classes
called “managed providers” are used for different functionalities of
data access
ADO .net Managed Providers
These are the different providers
Provider optimized for SQL 7
OLE – DB provider
A generic ODBC provider
Provider for Oracle
saved!"
Catch exp As Exception
lblOutput.Text = "An error occurred:" + exp.Message
Finally 'Ensure connection is closed
If (conn.State <> ConnectionState.Closed) Then
conn.Close()
End Try
Datasets
Datasets are new to ADO .net.