Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
258 Points
84 Posts
Apr 13, 2012 10:50 PM|LINK
hi
i think your problem might be with your SQL statement. i see that you are using "FROM" 2 times.
""SELECT [Name] FROM TableName, ID TableID FROM locations WHERE xtype = 'u'"""
i dont think this syntax is incorrect. i would also sugest to put the result into a datatable a bind it to the dropdownbox. something like : mysqldataadapter a = new mysqldataadapter("SELECT.....",connect);
datatable b = new datatable();
a.fill(b);
dropdownlist.datasource = b;
dropdownlist.databind();
ruipedromach...
Member
258 Points
84 Posts
Re: Populate a dropdown list from a list of table
Apr 13, 2012 10:50 PM|LINK
hi
i think your problem might be with your SQL statement. i see that you are using "FROM" 2 times.
""SELECT [Name] FROM TableName, ID TableID FROM locations WHERE xtype = 'u'"""
i dont think this syntax is incorrect.
i would also sugest to put the result into a datatable a bind it to the dropdownbox.
something like :
mysqldataadapter a = new mysqldataadapter("SELECT.....",connect);
datatable b = new datatable();
a.fill(b);
dropdownlist.datasource = b;
dropdownlist.databind();