Thread: combobox
View Single Post
Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

Re: combobox

 
0
  #3
Jan 5th, 2009
Hi You Must try this
  1. Protected Sub DropDownList1_SelectedIndexChanged()
  2. con=new sqlcnnection(constr)
  3. adpt=new sqldataadapter("select dept_code from T.N. where dept_name='"+dropdownlist1.selecteditem+"'",con)
  4. ds=new dataset
  5. adpt.fill(ds,"T.N.")
  6. dim i as string=ds.tables(0).rows(0).item(0)
  7. dropdownlist2.item.clear()
  8. dropdownlist2.item.add(i)
  9. End Sub
Last edited by Narue; Jan 5th, 2009 at 9:30 am. Reason: added code tags
Reply With Quote