In this article, I explain the basic details of ADO.NET.
ADO.NET
What ADO.NET is
- system.Data
- system.Data.OleDb
- system.Data.SqlClient
- system.Data.OracleClient
- system.Data.Odbc
Let's see the details of all these namespaces.
1. System.Data
This namespace is used for holding and managing data on a client machine.
This namespace contains the following set of classes:
- DataSet
- DataTable
- DataRow
- DataView
- DataColoum
- DataRelation
2. System.Data.OleDb
This namespace can communicate with any Data Sourcem like files, databases, indexing servers, and so on using the “OleDb” Provider.
3. System.Data.SqlClient
This namespace can communicate with “SQL Server” DataBase only using SqlClient Providers.
4. System.Data.OracleClient
This namespace can communicate with an “Oracle” DataBase only using OracleClient Providers.
5. System.Data.ODBC
This namespace contains the same set of classes as the following:
- Connection
- command
- DataReader
- DataAdaptar
- CommandBuilder
- Parameter
Note
Here each class is referred to by prefixing with their namespace before the class name to discriminate between each other as in the following:
- OleDbConnection: OledbCommand
- SqlConnection: SqlCommand
- OracleConnection: OracleCommand
Performance Operations on a DataSource
- Establishing a connection with a DataSource.
- Sending a request as an SQL Statement.
- Capturing results by the data Source.
1. Establishing a Connection
Connecting is a collection of attributes that are used for connecting with the data source. Those are:
- Provider
- Data Source
- User Id and Password
- Database or Initial Catalog
- Trusted Connection or Integrated Security
- DSN
1. Provider
As explained earlier, a provider is required for connecting with any data source where we use a different provider for each data source.
For example:
- Oracle: MsdOra
- SqlClient: SqlOledb.
- Microsoft Access or Excel: Microsoft jet OleDb 4.0
- Microsoft Indexing Server: Msidx.
2. DataSource
It is the name of the target machine to which we want to correct. This is optional when the data is on the local machine.
3. User id and password
Since databases are secured places for storing data, to connect with them we require a valid user name and password.
Oracle: scott/tiger
For SQL Server the default user name is “sa” and the password is that which we provide at the time of installation of SQL Server.
4. DataBase Or Initial Catalog
These attributes are used when connecting with SQL Server to specify the name of the database that we want to connect with.
5. Trusted-connection or Integrated Security
These attributes are also used when connecting with SQL Server only to specify that we want to use Windows Authentication.
6. DSN
This attribute is used when connecting with data sources using ODBC Drivers.
For example:
SQL Server: sa/<pwd>.
- “provider =sqldb;userid=sa;password =<pwd>;DataBase=<DBname>;[DataSource=<Server>]”

Abhijit PatilPosted Mar 28, 2014, 2:38 AM
sandeep sharma thank for suggestion ,but here i consider database on server machine not in local machine.
Sandeep SharmaPosted Mar 28, 2014, 2:10 AM
2. DataSourceIt is the name of the target machine to which we want to correct with. This is optional when the data is on the local machine. (Make Corrections ASAP :- Its connect, not correct) Sir take care about such mistakes. :-)