| Author: ammiraju 01 Jun 2009 | Member Level: Silver Points : 0 |
Hi,
Use DropDownList Datasource property.
|
| Author: Ramya 01 Jun 2009 | Member Level: Silver Points : 1 |
dropdownlist1.datatextfield = dt[0].toString() ;dropdownlist1.datavaluefield = dt[1].toString dropdownlist1.datasource = dt; ();dropdownlist1.databind();
|
| Author: Danasegarane.A 01 Jun 2009 | Member Level: Diamond Points : 2 |
This is the Poor method binding.. I don't know who approved this....
It should be like
sqldataadapter ada = new sqldataadapter("select * from tablename",conn); Datatable dt = new Datatable(); ada.fill(dt); dropdownlist1.datasource = dt; dropdownlist1.datatextfield = "Name"; dropdownlist1.datavaluefield = "ID"; dropdownlist1.databind();
|
| Author: Anand 02 Jun 2009 | Member Level: Silver Points : 1 |
hi,
Using the DDl DataSource property.
dropdownlist1.datatextfield = dt[0].toString() ; dropdownlist1.datavaluefield = dt[1].toString(); dropdownlist1.datasource = dt; dropdownlist1.databind();
|
| Author: Abhay 02 Jun 2009 | Member Level: Diamond Points : 1 |
sqldataadapter ada = new sqldataadapter("select * from tablename",conn);Datatable dt = new Datatable(); ada.fill(dt); dropdownlist1.datasource = dt; dropdownlist1.datatextfield = dt[0].toString(); dropdownlist1.datavaluefield = dt[1].toString(); dropdownlist1.databind();
|