What do you mean by 'a single column'?
Do you just want to fill the 'Text' property and leave the 'Value' empty?
If you only have one column on the database, you can link both the 'Text' and 'Value' to that column:
Combo1.DataSource = MyDt
Combo1.DataTextField = "MyCol1"
Combo1.DataValueField = "MyCol1"
Combo1.DataBind()
If you really want to leave the value empty, try adding an empty dumb column to your SQL:
"SELECT '' AS ColEmpty, MyCol1 FROM MyTable"
Then link it like this:
Combo1.DataSource = MyDt
Combo1.DataTextField = "MyCol1"
Combo1.DataValueField = "ColEmpty"
Combo1.DataBind()
Hope this helps, but if this is not what you were looking for, please explain it better.
NetAngel
Thanks for your reply.
My query was to populate a dropdownlist control with data from database.
Basically i wanted to populate that field with one table column.
anyways the problem is resolved now.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.