0% found this document useful (0 votes)
16 views5 pages

Unit 4 C#

The document discusses ADO.NET which is a module used to establish connections between applications and data sources like SQL Server and XML. It consists of classes used to connect, retrieve, insert and delete data from these sources. The document also describes the architecture of ADO.NET including components like connections, commands, data readers, datasets and data adapters.

Uploaded by

chauhanjeel57
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
16 views5 pages

Unit 4 C#

The document discusses ADO.NET which is a module used to establish connections between applications and data sources like SQL Server and XML. It consists of classes used to connect, retrieve, insert and delete data from these sources. The document also describes the architecture of ADO.NET including components like connections, commands, data readers, datasets and data adapters.

Uploaded by

chauhanjeel57
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 5

 ADO.

NET
 ADO.NET is a module of .Net Framework which is used to establish connection between
application and data sources.
 Data sources can be such as SQL Server and XML. ADO.NET consists of classes that can
be used to connect, retrieve, insert and delete data.
 ADO stands for Microsoft ActiveX Data Objects. ADO.NET is one of Microsoft’s Data
Access Technologies, using which we can communicate with different data sources.
 ADO.NET consists of a set of predefined classes that can be used to connect, retrieve,
insert, update, and delete data (i.e., performing CRUD operation) from data sources.
 ADO.NET data providers contain classes that represent the provider's Connection, Command,
DataAdapter and DataReader objects (among others).

 ADO VS ADO .NET


 ADO.NET Architecture

1.Connection:
 The first important component of ADO.NET Architecture is the Connection Object.
 The Connection Object is required to connect with your backend database which can be
SQL Server, Oracle, MySQL, etc.
 To create a connection object, you need at least two things. The first one is where is
your database located i.e. the Machine name or IP Address or someplace where your
database is located.
 And the second thing is the security credentials i.e. whether it is a Windows
authentication or SQL Authentication i.e. user name and password-based authentication.
 the first is to create the connection object and the connection object is required to
connect the front-end application with the backend data source.
2.Command:
 The Second important component of ADO.NET Architecture is the Command Object.
 The Command Object is the component where you go and write your SQL queries. Later
you take the command object and execute it over the connection.
 That means using the command object, you can fetch data or send data to the database
i.e. performing the Database CRUD Operations.
3.DataReader:
 DataReader is a read-only connection-oriented recordset that helps us to read the
records only in the forward mode.
 Here, you need to understand three things i.e. read-only, connection-oriented, and
forward mode.
 Read-Only means using DataReader, we cannot Insert, Update, and Delete the data.
 Connection-Oriented means, it always requires an active and open connection to fetch
the data.
 Forward mode means you can always read the next record, there is no way that you can
read the previous record.
4.DataSet:
 It is a Disconnected record set that can be browsed in both i.e. forward and
backward mode.
 It is not read-only i.e. you can update the data present in the data set. Actually,
DataSet is a collection of DataTables that holds the data and we can add, update,
and delete data in a data table.
 DataSet gets filled by somebody called DataAdapter.
5.DataAdapter:
 The DataAdapter is one of the Components of ADO.NET which acts as a bridge
between the command object and the dataset.
6.DataView Class
 The DataView class enables us to create different views of the data stored in a
DataTable.
 This is most often used in data-binding applications.
 Using a DataView, we can expose the data in a table with different sort orders, and
you can filter the data by row state or based on a filter expression.
7.DataProvider
 Data provider is used to connect to the database, execute commands and retrieve the
record. It is lightweight component with better performance. It also allows us to place
the data into DataSet to use it further in our application.
 Data Binding

 Data binding allows us to bind data objects to one or more web controls, that will show the data
automatically.
 The data binding model is extensible. We can extend it with new functionality The data binding
is defined outside the source code. The data binding in ASP.NET is declarative. We define it
within the ASP.NET web page.
 Data binding is the process that establishes a connection between the application UI and
business logic.

 Simple Data Binding


 Simple Data Binding is the process of binding the control with the single value in the
dataset. The controls like text box, label can be bound to the control through the control
properties.

 Complex Data Binding


 The Complex Data Binding is the process of binding the component with the Database.
The controls can be GridView, Dropdown list, or combo box. Multiple values can be
displayed from the dataset through the binding.
1. DataGridView: It is used to display the multiple records and columns. The
DataSource property of the DataGridView control is used for binding the specific
data element.
2. ComboBox: The control contains a text box for entering the data and drop down
list for displaying the values. The DataSource property is useful for binding the
control. The element specific information can be bind through the DisplayMember
property

 Single-Value Data Binding

 It allows you to take a Page variable, property, or an expression and insert it dynamically
into a page. In other words, it allows you to pop data into HTML elements .use it, you
add special data binding expressions into your .aspx files. These
expressions have the following format:

<%# expression_goes_here %>

 Repeated Value Data Binding


 Repeated-value Data Binding works with the ASP.NET List controls (e.g. ListBox) and
Rich Data Controls (e.g. GridView), which are all controls with a DataSource property.
 The repeated value binding allows us to bind an entire list of information to control on our
web page.
 The information is represented by an object that wraps a collection of objects.
 Three Tiers of Web Applications.

1. Presentation Layer

 This is the top layer of architecture.


 The topmost level of application is the user interface.
 It is related to the user interface that is what the user sees.
 The main function of this layer is to translate tasks and results in something which the user can
understand.
 It contains pages like web forms, windows form where data is presented to the user and use to
take input from the user. The presentation layer is the most important layer because it is the one
that the user sees and good UI attracts the user and this layer should be designed properly.

2. Business Layer

 This is the middle layer of architecture.


 This layer involves C# classes and logical calculations and operations are performed under this
layer.
 It processes the command, makes logical decisions and perform calculations.
 It processes data between these two layers. This layer implements business logic and
calculations.
 This layer also validates the input conditions before calling a method from the data layer. This
ensures the data input is correct before proceeding, and can often ensure that the outputs are
correct as well. This validation of input is called business rules.

3. Data Layer

 This layer is used to connect the business layer to the database or data source.
 It contains methods which are used to perform operations on database like insert, delete,
update, etc.
 This layer contains stored procedures which are used to query database. Hence this layer
establishes a connection with the database and performs functions on the database.

You might also like