Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

assign value to combobox?

i have a combobox in my window form which i set the item collection to buy and sell...

then now i read the data from database, the data is either buy and sell also, how can i assign the data to the combobox....for example the data now is buy, how can the combobox show buy now?

something like if i read a data from database and assign the data to the textbox, i would write
SqlDataReader myReader;
myReader = cmd3.ExecuteReader();
if (myReader.Read())
{
txtunit.Text=myReader["P_UNITS"].ToString(); //textbox

}

But, now, how am i going to write, if i want to assign the value read from database to a combobox?
[682 byte] By [shanny] at [2007-11-11 8:18:40]
# 1 Re: assign value to combobox?
cboBox.Text = myReader["columnName"].ToString();
Phil Weber at 2007-11-11 21:47:41 >