Selecting a value in a combobox

Hi I am new to c# winforms and came from the webapps world.

I have a combo box that has a collection value in it
County
State
Town
Private

I am reading the owner form the database and want to set the value to what it is in the database (will always be one of the collection values or null)

In the asp.net c# world I used
findValue = reader["Owner"].ToString();

ddOwner.SelectedValue = ddOwner.SelectedIndex = ddOwner.Items.IndexOf(ddOwner.Items.FindByValue(findValue));

But in the winforms world I am getting an Error because Items has no FindByValue method defined.

How can I set the comboBox to the value i retrieved form the database?

Thanks
Charles BaldoSoftware DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Anurag ThakurConnect With a Mentor Technical ManagerCommented:
this should work
ddOwner.SelectedValue = findValue;
0
 
Charles BaldoSoftware DeveloperAuthor Commented:
Wow too easy, I think I am going to like doing winforms instead of webapps
0
All Courses

From novice to tech pro — start learning today.