Basic Details with ADO.NET



In this article I demonstration Basic detail with ADO.NET.
ADO.NET:-
             ADO.NET   stands for Active Data Object .
What is ADO.NET
                             it is collection of managed libraries used by .net application for data source communication with the help of driver or provider
                ADO.NET  provide libraries for the datasource communication under the following namespaces.
                         1)  system.Data
                         2) system.Data.OleDb
                         3) system.Data.SqlClient
                         4) system.Data.OracleClient
                         5) system.Data.Odbc
Lets details with all these namespaces.
 1)System.Data :-
                    This namespace are used for holding and managing of data on client machine.
        This NameSpace contains  following set of Classes.
1)DataSet 
2)DataTable
3)DataRow
4)DataView
5)DataColoum
6)DataRelation             
 
2)System.Data.OleDb :-
                               This Namespace can communicate with any Data Source like  Files,DB’s, indexing Servers etc using “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  “Oracle” DataBase only using OracleClient Providers.
   5)System.Data.ODBC :-
                                this Namespace contains same set of classes as following
1)Connection                
 2)command
 3)DataReader  
 4)DataAdaptar
 5)CommandBuilder
   6)Parameter

     Note:
               here each class is reffered  by prefexing with their namespace before class name to discriminate between each other as following
 
    OleDbConnection    - OledbCommand
    SqlConnection                  - SqlCommand
    OracleConnection            - OracleCommand
  Performance Operations on a DataSource :-
                   each and every operation we perform on a data source involves of 3 steps
   1)    establishing a connection with DataSource.
   2)   sending Request as an Sql Statement.
  3)    capturing results by the data Source.
  
1)   Establishing a Connection :-
                   Connecting is a collection of attribures that are used for connecting with the data Source.
Those are:
1)Provider
2)Data Source
3) User Id & Password
4)Database or Initial Catlog
5)Trusted Connection or Intregrated  Security
6)DSN
  
1)   Provider :-
                   as  discussed earlier provider is required for connectiong with any data source where we use a different provider for each data Source.
Eg
    oracle            - >  MsdOra
   SqlClient        - >  SqlOledb.
  Ms Access or Excel   -> Microsoft jet OleDb 4.0
Ms Indexing Server   -> Msidx.

2)  DataSource :-
                   it is the name of target  machine to which we want to correct with this is  optional when the data is on local machine.

3)User id and Password :-
                  as database are secured places for storing data,to connect with them we require a valid user name and password.

     Oracle  à scott/tiger
     Sql Server  -> sa/<pwd>.

For Sql Server Default User Name is “sa” and Password is which we provide at the time of installation of Sql Server.

4)DataBase Or Initial Catlog :-
                   these attribute are used while connecting with sql server to specify the name of Database which  we want to connect with them.

5)Trusted –connection or Intergrated Security :-
                  these attributes are also used while connectiong with sql server only to specify that we want to use windows authentication..

6)   DSN :-
                   this attribute are used while connecting with data sources using odbc Drivers.
Eg.
“provider =sqldb;userid=sa;password =<pwd>;DataBase=<DBname>;[DataSource=<Server>]”

   Member of Connection Class :-

     1)Open( )  :-
                   open a connection with data source.

   2)Close( )   :-
                     close the connection that is closed.

    3)state :-
                 get  the status of connection

   4)connectionString :-
                    gets or sets a connection string associated with the connection object.

Hope you understand basic concept related to ADO.NET.
If you want to learn more article visit my blog
Dotnetbyabhipatil.blogspot.in
  



         
Previous
Next Post »