list box fill

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
Hi,

What particular type of list box is it? What is the datasource (DataSet,
DataReader, etc.)?
Typically you can databind a listbox control to a DataTable instance,
specifying which column to use as the 'key' and which as the value to be
displayed.
 
It is a normal listBox control and I would like to fill it through dataset.


Dmytro Lapshyn said:
Hi,

What particular type of list box is it? What is the datasource (DataSet,
DataReader, etc.)?
Typically you can databind a listbox control to a DataTable instance,
specifying which column to use as the 'key' and which as the value to be
displayed.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Hrvoje Voda said:
How to Fill a listbox with data from database?

Hrcko
 
For a Windows Forms code sample, please refer to the DataSource property
MSDN documentation for the System.Windows.Forms.ListBox class.
For a Web Forms list box, the approach is similar, but the names of
properties for the display member and the value member are different.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Hrvoje Voda said:
It is a normal listBox control and I would like to fill it through
dataset.


Dmytro Lapshyn said:
Hi,

What particular type of list box is it? What is the datasource (DataSet,
DataReader, etc.)?
Typically you can databind a listbox control to a DataTable instance,
specifying which column to use as the 'key' and which as the value to be
displayed.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Hrvoje Voda said:
How to Fill a listbox with data from database?

Hrcko
 
Back
Top