0% found this document useful (0 votes)
155 views11 pages

Ado. Net Part 2 Data Binding of Form Controls, Connected Vs Disconnected Architecture Presented by

1. Data binding in .NET allows visual elements in a client to connect to a data source like DataSets or Arrays. This establishes a two-way connection where changes to the data source are reflected in visual elements and vice versa. 2. Disconnected architecture refers to a mode where connectivity between the database and application is not maintained continuously. Connectivity is only established to read data from or update data to the database. 3. In disconnected architecture, a DataAdapter is used to transfer data between the database and a dataset. It contains commands like Select, Insert, Update, and Delete to facilitate this transfer of data.

Uploaded by

kainat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views11 pages

Ado. Net Part 2 Data Binding of Form Controls, Connected Vs Disconnected Architecture Presented by

1. Data binding in .NET allows visual elements in a client to connect to a data source like DataSets or Arrays. This establishes a two-way connection where changes to the data source are reflected in visual elements and vice versa. 2. Disconnected architecture refers to a mode where connectivity between the database and application is not maintained continuously. Connectivity is only established to read data from or update data to the database. 3. In disconnected architecture, a DataAdapter is used to transfer data between the database and a dataset. It contains commands like Select, Insert, Update, and Delete to facilitate this transfer of data.

Uploaded by

kainat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

1

ADO. NET PART 2


DATA BINDING OF FORM CONTROLS,
CONNECTED VS DISCONNECTED
ARCHITECTURE

PRESENTED BY
HAMZA MALIK
KAINAT PARVEEN
MAHNOOR FATIMA
AHMED IFTEKHAR
1
Data Binding In Windows Forms, you can bind to not
just traditional data sources, but also to
and Windows almost any structure that contains data.
Forms You can bind to an array of values that
you calculate at run time, read from a file,
or derive from the values of other
controls.
You might use binding to perform the
following tasks:
• Setting the graphic of an image control.
• Setting the background colour of one or
more controls.
• Setting the size of controls.
2
Data Binding Types of Data Binding

and Windows • One way data binding


Forms • One way data binding is a change in the state affects the
view from component to view template or change in the
view affects the state from view template to
component.
• Two-way data binding
• Two-way data binding is a change from the view
can also change the model and similarly changes in
the model can also change in the view from
component to view template, and also from view
template to the component.
2
Data Binding
Simple data binding The ability of a control to bind to a
and Windows single data element, such as a
value in a column in a dataset
Forms table. This is the type of binding
typical for controls such as a
control, which are controls that
typically only displays a single
value. In fact, any property on a
control can be bound to a field in a
database. There is extensive
support for this feature in Visual
Studio

Complex data binding The ability of a control to bind to


more than one data element,
typically more than one record in
a database. Complex binding is
also called list-based binding.
Examples of controls that support
complex binding are the data grid
and view list box.
1 • What is data binding
• DataBinding is a powerful feature provided by
2 the .NET Framework that enables visual
elements in a client to connect to
3 a datasource such
as DataSets, DataViews, Arrays, etc. Some of
the visual elements in the client can
4 be TextBox, Datagrid, etc. A two-way connection
is established such that any changes made to
the datasource are reflected immediately in the
5
visual element and vice versa.
• Below is a graphical description of the concept
6
of databinding:
Advantages

Databinding in .NET can be used to write data driven applications


quickly. .NET data binding allows you to write less code with fast Databinding with .NET
execution but still get the work done in the best way. The .NET Framework provides a very flexible and
.NET automatically writes a lot of databinding code for you in the
background (you can see it in "Windows Generated Code" section), powerful approach to databinding and allows the
so the developer does not have to spend time writing code for basic programmer to have a fine control over the steps
databinding, but still has the flexibility of modifying any code that he
would like to. We get the benefits of bound as well as unbound involved in the whole process. One of the biggest
approach. improvements with .NET has been the introduction of
Control over the Databinding process by using events. This is
discussed in more detail later in the article. databinding to web pages through the use of .NET
server-side web controls. Hence, building data driven
Disadvantages of Databinding web applications has been greatly simplified. Please
More optimized code can be written by using the unbound or note that this article only deals with data binding in
traditional methods. .NET Windows Forms.
Complete flexibility can only be achieved by using the unbound
approach.
8
DISCONNECTED
9

ARCHITECTURE:-
Disconnected architecture refers to the mode of architecture in Ado.net where the
connectivity between the database and application is not maintained for the full time.
Connectivity within this mode is established only to read the data from the database and
finally to update the data within the database.
DataAdapter in Disconnected 10
Architecture:-

DataAdapter is used to transfer the data


between database and dataset. It has
commands like select, insert, update
and delete.
Forexample:- 11

public DataTable GetTable(string query)


{
SqlDataAdapter adapter = new
SqlDataAdapter(query, ConnectionString);
DataTable Empl = new DataTable();
adapter.Fill(Empl);
return Empl;
}

You might also like