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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

checked listbox check all 3
checked list box 3
class 3
imageList 2
checked item 1
array list 15
sum 4
list box checked 2

Back
Top