c# - How to display a selected item in combobox that is selected from database -


i have combobox items. want value database , show value in combobox selected item. should display items.

i tried use combobox.selectedvalue. it's not working.what should do?

  sqldataadapter komut = new sqldataadapter("select * ogrenci ogr_no= '" +             convert.toint32(a) + "' ", baglanti);          datatable dt = new datatable();         komut.fill(dt);         datarow drw1 = dt.rows[0];         string ogretim = drw1["ogretim"].tostring();         //combobox7.selecteditem = combobox7.findstring(ogretim);         combobox7.selectedvalue = ogretim; 

try this:

combobox7.items.findbyvalue(ogretim).selected = true; 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -