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

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 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?

Charles BaldoSoftware DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

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

From novice to tech pro — start learning today.