Data management with ado

Preview:

DESCRIPTION

 

Citation preview

DATA MANAGEMENT WITH ADO.NET

ADO.NET

Introduced in ver 1.0 of .NET

Used to manage data contained in a relational database.

ADO.NET 1.0

DataReaderDataSet

ADO.NET 2.0

Introduced many new features

Common ADO.NET Tasks

Selecting DataInserting DataUpdating DataDeleting Data

Basic ADO.NET Namespaces and

ClassesSystem.DataSystem.Data.CommonSystem.Data.OleDbSystem.Data.OdbcSystem.Data.SqlClientSystemData.SqlTypes

Using Connection Object

Properties of ConnectionConnectionStringDataSourceDatabaseState

Connection

Dim conn as SqlConnection

Conn=new SqlConnection(“server=localhost;uid=sa;pwd=;database=Northwind”);

conn.Open()

Command Object

Used to execute SQL queries

Properties of SqlCommand

CommandTextCommandTimeoutCommandTypeConnection

Execute Methods of Command Object

ExecuteNonQueryExecuteReaderExecuteRowExecuteScalarExecuteXmlReader

DataAdapterBridges gap b/w disconnected DataTable object and Physical data source

It can execute SELECT on datasource

It can execute INSERT, DELETE, UPDATE operations

DataAdapterPropertiesSelectCommand InsertCommandUpdateCommandDeleteCommand

Using Parameters

Properties of SqlParameter ParameterName SqlDbType Size Direction SourceColumn Value

Recommended