TechnoTone Posted July 23, 2003 Posted July 23, 2003 I have successfully connected to a SQL Server and executed a stored procedure. I now have an SqlDataReader with my data and I want to populate a combo-box. Is there a way to get the data to the combo-box without running through the records one-by-one? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
TechnoTone Posted July 23, 2003 Author Posted July 23, 2003 I am unable to set the combobox.DataSource property to a SqlDataReader as it doesn't support either an IList or an IListSource interface. Anyone else? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
karimgarza Posted July 23, 2003 Posted July 23, 2003 the way you have to do it is the following: *use a dataadapter to bring the data *fill a dataset with the data *set the datasource property of the listbox to the correct dataset such as dataset1.table1 *set the display member to the field you want to display and you are done. if have trouble creating the dataadapter on code use the wizard. Best of Luck Quote You're either a one or a zero. Alive or dead.
TechnoTone Posted July 23, 2003 Author Posted July 23, 2003 Thanks. Sorted! Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.