Explain Ado.Net in Asp.Net

Explain Ado.Net in Asp.Net

Microsoft Ado.Net

Definition:-

  • It stands for activeX data object.net and was introduced by microsoft in 2002.
  •  the .net framework has introduced a new set of database classes designed for loosely coupled, distributed architecture. 
  • These classes are referred to as ado.net. 
  • Ado.net is the new technology and used to connect with different data source. 
  • It provides interoperability and scalable and data access by xml .
  • you can connect with your data source using Ado.net.  

   Ado.Net Architecture:- the ado.net consist of a set of objects that expose data access service to the .net environment.
  system.data name space is the core of ado.net and it contains classes used by all data providers.ado.net is designed to be easy to use and visual studio provide several wizard and other features that you can use to generate ado.net data access code.
Fig:Ado.Net Architecture
ado.net has two main component are:-
        1.data provider
        2. data set
       






Data Provider:- ado.net provider the way to connect with the data base,there are lots of database like SQL server, orcle,DB2,MS access etc. data provider is the way to connect with these data source.we can choose the correct protocol as per the used data source. ado.net provides data provider For:-

  1. SQL client - to connect with sql server(system.data.sqlclient)
  2. ORACLE client - to connect with oracle server(system.data.oracleclient)
  3. ODBC -used to connect with the older database(system.data.odbc)
  4. OLEDB -used to connect with the excel or MS access(system.data.oledb)
Fig:Data Provider
                                        Data provider contain connection,command,data adapter and data reader objects these four object provides the functionality of data provider in ADO.net . These four data provider define below in ado.net objects.
     

Ado.net Objects:-  the data provider and ado.net objects are not different. ado.net object like data providers ,ado.net object  are common and used as it is with all data provider.
ADO.net object model is divided into two categories:-

  1. Connected environment
  2. Data set(disconnected  environment)                                                                                 
ado.net object is use four components are:-

  1. Connection(sql connection):-this method is used to make connection with data base from .net application .the connection object providers physical connection to the data source.connection object needs the necessary information to recognise the data source and to log on to it properly this information is provided though a connection string.
          sqlconnection objcon= new sqlconnection(configurationManager.appsettings["connectionstring"].to strin())
 
      2. Command(sql command):- with help of this command you communicate with         the data base.you can directly pass the query or you can use "stored procedure".the command              object uses to perform SQL statement or stored procedure to be executed at the data source .the            command object provides a number of execute method that can be used to perform the sql queries       in a variety of fashions
                 sqlcommand  cmd = new sqlcommand("your query",objcon);
 
       3. DataReader(sql DataReader):-  the data reader object is a stream-based, forward-only, read  -          only retrival of query result from the data source ,which do not update the data. data reader                 requires a live connection with the data base and provides a very intelligent way of consuming all       or part of the result set.
                      sqlDataReader  reader = cmd. ExecuteReader();
 
       4. Data Adapter:- data adapter object populate a data set object with results from a data source. it is a special class whose purpose is to bridge the gap between the disconnected data set object and the physical data source.
                    sql DataAdapter DA = new sql DataAdapter(cmd0;
                            dataset ds =new dataset();
                               DA.Fill(ds);


Data Set:-  dataset provides a disconnected representation of result sets from the data source, and it is completely independent from the data source. data set provides much greater flexibility when dealing with related results sets.
                           data set contain rows,column,primary key,constraints and relations with other datatable objects.it consist of a collection of data table objects. that you can relate to each other with data relation objects. the data adapter object provide a bridge b/w the data set and the data source.


 
Fig:Data Set
 


    In hindi:-
ADO.NET microsoct ki tarf se banai gyi technogy hai. Yeh 2002 me bnai gyi hai. Ado.net ko m basically kh sakte hai ki ye set h classes ka .net framework ki. Ado.net se hum database ko access and data source se connect kr sakte hai.
 Iske 2 main component hai 1. Data provider and 2 data set.


Microsoft ADO.NET:-

यह activeX डेटा object.net के लिए खड़ा है और 2002 में Microsoft द्वारा पेश किया गया था।
 ढांचागत रूप से युग्मित, वितरित आर्किटेक्चर के लिए डिज़ाइन किए गए डेटाबेस वर्गों का एक नया सेट शुरू कर दिया है।
इन वर्गों को ado.net के रूप में संदर्भित किया जाता है
Ado.net नई तकनीक है और विभिन्न डेटा स्रोत से जुड़ने के लिए उपयोग किया जाता है।
यह एक्सएमएल द्वारा इंटरऑपरेबिलिटी और स्केलेबल और डेटा एक्सेस प्रदान करता है
आप Ado.net का उपयोग करके अपने डेटा स्रोत से जुड़ सकते हैं।
Ado.net के दो मुख्य घटक हैं: -

        1.डेटा प्रदाता
        2. डेटा सेट
.Net Framework Notes


EmoticonEmoticon