Groups | Blog | Home
all groups > dotnet ado.net > january 2005 >

dotnet ado.net : Connected vs disconnected application


Sahil Malik
1/31/2005 4:31:36 AM
[quoted text, click to view]

Yes -- Here is how --
http://codebetter.com/blogs/sahil.malik/archive/2004/12/11/36078.aspx

[quoted text, click to view]

Here are my thoughts about connnected vs. disconnected. (SqlDataAdapter is
disconnected and SqlCommand/SqlDataReaders are connected).
http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48711.aspx

HTH :-)

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/




[quoted text, click to view]

Cor Ligthert
1/31/2005 10:36:57 AM
Nicolae,

With ADONET when you get data or write data there is forever a connection.

When you are reading data, than the connection is there (when you do it
well) as long as the datareader is reading (which is as well used in the
fill from a dataset).

Of course can you populate with the datareader a Combobox using the
items.add in.

However the combobox itself is disconnected.

The contrapart is OleDB what is a connected situation. In OleDB is a
recordset used which is constantly keeping connection with the Database. A
concept that looks nice however has a lot of problems had to be overcome.

Therefore the new direction is choosen, the dataset (not to mix up with the
recordset because it holds relations and datatables where the last you can
compare as disconnected recordsets). A simple example why disconnected,
think on a PDA.

I hope this gives some idea's

Cor

Mona
1/31/2005 3:15:42 PM
Hi Nicolae,

A .NET Framework data provider is used for connecting to a database,=20
executing commands, and retrieving results. Those results are either =
processed=20
directly, or placed in an ADO.NET DataSet in order to be exposed to the =
user=20
in an ad-hoc manner, combined with data from multiple sources, or =
remoted between=20
tiers.
You can use the Data Reader to populate your Combo Box..A data reader =
reads a forward-only,=20
read-only stream of data from a data source.So, incase you don't want =
any manipulation in the data and=20
have to read all at once, you should go for Data Reader as it is more =
economical in terms of load on your
application.
The DataSet object is central to supporting disconnected, distributed =
data scenarios with ADO.NET.=20
The DataSet is a memory-resident representation of data that provides a =
consistent relational programming=20
model regardless of the data source. It can be used with multiple and =
differing data sources, used with XML=20
data, or used to manage data local to the application. The DataSet =
represents a complete set of data including=20
related tables, constraints, and relationships among the tables.

An ADO.NET DataSet contains a collection of zero or more tables =
represented by DataTable objects.=20
The DataTableCollection contains all the DataTable objects in a DataSet.

So,in cases you want a light weight connection or data from more than =
one table,DataSet is the option for you.

HTH

Mona

[quoted text, click to view]
Nicolae Fieraru
1/31/2005 3:46:56 PM
Hi All,

I read in a book that a program can connect to a database using two
different types of connections to a database. In case the program can
maintain a direct connection, classes such as OleDbConnection, OleDbCommand
and OleDbDataReader can be used.
The other option is to create a disconnected application, using an
OleDbDataSet.
and an OleDbDataAdapter.

I want to populate a ComboBox from a table. I know how to do this only for
disconnected applications. Is it possible to use a connected application to
populate a ComboBox? If I can use any method, which one should I use? How
should I decide which one to preffer among them two?

Regards,
Nicolae

Nicolae Fieraru
1/31/2005 11:35:15 PM
Thank you Sahil, I read your blog. I consider the information presented in
there to be useful. I also had a look at the code with the datareader and I
found a few good ideas in there.

Regards,
Nicolae

Nicolae Fieraru
1/31/2005 11:52:18 PM
Thank you Mona, you described very well the advantages of using a =
DataSet.=20
I managed to fill in the combobox using a datareader as well, but now =
I've got another problem.=20
I will post another question.

Regards,
Nicolae

[quoted text, click to view]
Hi Nicolae,

A .NET Framework data provider is used for connecting to a database,=20
executing commands, and retrieving results. Those results are either =
processed=20
directly, or placed in an ADO.NET DataSet in order to be exposed to =
the user=20
in an ad-hoc manner, combined with data from multiple sources, or =
remoted between=20
tiers.
You can use the Data Reader to populate your Combo Box..A data reader =
reads a forward-only,=20
read-only stream of data from a data source.So, incase you don't want =
any manipulation in the data and=20
have to read all at once, you should go for Data Reader as it is more =
economical in terms of load on your
application.
The DataSet object is central to supporting disconnected, distributed =
data scenarios with ADO.NET.=20
The DataSet is a memory-resident representation of data that provides =
a consistent relational programming=20
model regardless of the data source. It can be used with multiple and =
differing data sources, used with XML=20
data, or used to manage data local to the application. The DataSet =
represents a complete set of data including=20
related tables, constraints, and relationships among the tables.

An ADO.NET DataSet contains a collection of zero or more tables =
represented by DataTable objects.=20
The DataTableCollection contains all the DataTable objects in a =
DataSet.

So,in cases you want a light weight connection or data from more than =
one table,DataSet is the option for you.

HTH

Mona

[quoted text, click to view]
Nicolae Fieraru
2/1/2005 12:00:54 AM

[quoted text, click to view]

Hi Cor. I figured it out in the meantime and this the way I've done it.

[quoted text, click to view]
For me it is ok if the combobox is disconnected.

[quoted text, click to view]

Thanks for your reply,
Nicolae

AddThis Social Bookmark Button