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] "Mona" <Mona@discussions.microsoft.com> wrote in message =
news:u0iNom3BFHA.3824@TK2MSFTNGP10.phx.gbl...
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" <nospam@please.com> wrote in message =
news:uwm9m$0BFHA.3588@TK2MSFTNGP11.phx.gbl...
> Hi All,
>=20
> I read in a book that a program can connect to a database using two=20
> different types of connections to a database. In case the program =
can=20
> maintain a direct connection, classes such as OleDbConnection, =
OleDbCommand=20
> and OleDbDataReader can be used.
> The other option is to create a disconnected application, using an=20
> OleDbDataSet.
> and an OleDbDataAdapter.
>=20
> I want to populate a ComboBox from a table. I know how to do this =
only for=20
> disconnected applications. Is it possible to use a connected =
application to=20
> populate a ComboBox? If I can use any method, which one should I =
use? How=20
> should I decide which one to preffer among them two?
>=20
> Regards,
> Nicolae=20
>=20