0

hey people!!

how are you all? I need some help here:
1) is there any way easyer to do this:

DataSet DS = new DataSet();
foreach (DataTable t in DS.Tables)
foreach (DataRow r in t.Rows)
foreach (DataColumn c in t.Columns)
   CBx.Items.Add(r[c]);

2) how can you order a combobox to focos on a certain Item that is already there? that is, to get the combobox to show a certain item (by code alone)

please help me!!

Gabs

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by Aun Muhammad
0

1) what are you trying to do? Add an option for every column in every table in your database?

2) again, what exactly are you trying to do, what have you tried? Are you trying to add all the columns and have a particular one selected when you are done?

0

I was wondering the same thing campkev.

If you just want the values of a single column in all the rows, set the data source and databind it.

0

(1)

Dataset ds=new dataset();
Data Table dt=ds.tables[0];
Foreach(DataRow dr in dt.rows()){}


(2)

u can do so by using following to get some value selected in combo..
cmbo.selectedindex=0;
try it out , change index to u r requirments....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.