Hi Jon:
You have two basic ways you can do it. 1) Iteratively - you can call the
..ExecuteReader method of the command object in either the SqlServer
(SqlClient) library if you are connected to the network or SqlCe and use the
listBox.Items.Add[DataReader.GetString[WhateverIndex]);
Or you can walk through a dataTable
foreach(DataRow dro in myDataTable.Rows){
myListBox.Items.Add(dro[ColumnIndex].ToString());
}
However, if you are using a DataTable, you can just set the dataSource
property of the control, then set the DisplayMemmber (which is what you want
the users to see in the box) and ValueMember (which is what the
..SelectedValue property will be if they select something) - these may or may
not be the same depending on what you need.
HTH,
Bill
www.devbuzz.com
www.knowdotnet.com
JonJon said:
hi, I am a programmer whose was changed to .net compact framework from
visual basic 6.0, I need to know if some knows how i fill a datalist whith
elements commings from a database.