Presentation is loading. Please wait.

Presentation is loading. Please wait.

ADO.NET. ADO.NET deals with accessing and manipulating databases.it comprises of many namespaces and classes to do so. ADO.NET provides access to datasources.

Similar presentations


Presentation on theme: "ADO.NET. ADO.NET deals with accessing and manipulating databases.it comprises of many namespaces and classes to do so. ADO.NET provides access to datasources."— Presentation transcript:

1 ADO.NET

2 ADO.NET deals with accessing and manipulating databases.it comprises of many namespaces and classes to do so. ADO.NET provides access to datasources such as Microsoft SQL server,OLE DB and XML. Application written in.NET compliant languages connect to these datasources to access manipulate or update the data

3 ADO(activeX data objects) ADO relied on a connection based mode.in the connection approach,the client had to be connected with the server(data source) and remain connected till the whole procedure or transaction was copleted.in such approach a lot of bandwidth was required. If 100 clients were to use a server,each would need a connection. Time,resources and bandwidth became a major constraint on such architecture.

4 To solve this problem latest version of ADO used record sets, All the content from the datasource was coppied from data source to record set..This allowed the client to get disconnected from the server,work on the record set and copy the changes back to data source again. It required COM marshalling to transmit disconnected data,it support only COM supported data types and it required type conversion.

5 ADO.NET ADO.NET supports both disconected and connected approach.In majority of situations disconected approach is used,in this approach transmission of data is in XML format.XML format places no restriction on the datatypes and require no type conversion.

6 ADO.NET COMPONENTS DATA SET.NET DATA Providers Is used for connecting to the database,executing commands and retreiving results.we can either access database directly or use the disconected approach.For the disconected approach we use the DATASET class.

7 .NET Data Providers A Data provider consists of following basic objects a)A connection object b)A command object c)A DataReader object d)A dataAdapter object

8 Connection object The connection object is used to connect to the data source.Data source can be any database file.The connection object contains the information like the provider name,server name, data source name,user name,password and so on/

9 Command object A command object is used to connect the connection object to a DataReader or DataAdapter object.The command object allows us to execute an SQL statement or stored procedures in a data source

10 DataReader The DataReader is used to read the data in a fast and efficient manner from the database.. It is generally used to extract one or a few records or a specific field value or to execute simple SQL statements.

11 DataAdapter object A DataAdapter is used to fill data from the database into the Dataset object.The dataAdater is used in disconnected approach.

12 .NET Data providers OLE DB.NET PROVIDER (MICROSOFT ACCESS) SQL SERVER.NET PROVIDER

13 Create a database Create a database in access and name it “bank”. Create a table and name it “account” It should be like the next slide. And fill it with appropriate data.

14

15 Now fill the data like this

16 Question of today ? Write a program to access these values and print them using ADO.NET Objects ?

17 1.Create an empty web site named it “bank” 2.Add a web page account.aspx in solution explorer.

18

19 DataSets ADO.NET imlements the disconected approach using the Dataset class.In the disconnected approach connection is established,the data from the database is copied to the cache and then connection is closed.Next we manipulate the data in the cache and then connect back to restore the data in the database.This approach saves time and resources.

20 Dataset class The dataset class is designed for dataaccess independent of the.NET Data Providers.it means that it does not matter whether we are using the SQL.net OR the OLE DB.NET provider.we can use the same class for both the providers.The DataSet class provides methods and properties to access the tables,rows and columns of the data source.

21 Datset (continued) A dataset object can hold more than one table from the datasource.it can also hold the relationship that exist between the table in the dataset.

22 Binding the GridView We must bind the grid view control to some data source.the control then automatically displays the records of the specified table


Download ppt "ADO.NET. ADO.NET deals with accessing and manipulating databases.it comprises of many namespaces and classes to do so. ADO.NET provides access to datasources."

Similar presentations


Ads by Google