Skip to content

Working with dropdownlists

swathi g

Asked Aug 8, 2006, 10:33 PM EDT1 answer
Share
LinkedInX
i have taken two dropdownlists..i am populating id s in onw and names in another...if i select id in 1st dropdownlist the corresponding name should be displayed in 2nd dropdownlist....and vise versa....i have done that...but i am facing one problem...intially all values r populating are correctly..if i select anything that particular values is duplicating....i am unable to explain my probel exactly....can u tell me how to solve this...

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    u can try the following things for ur problm let i ve emp table & eid & ename are 2 fields which i want to populate declare the dataset,command,data adapter,connection & establish the connection then writ the following in the form load event of the form da=new sqlclient.sqldataadapter("select eid,ename from emp group by eid,ename",cn) ds.clear ds.reset da.fill(ds,"emp") combobox1.items.add(ds.tables(0).rows(0)(0)) combobox2.items.add(ds.tables(0).rows(0)(1)) i think this will solve ur problm
    0