0

How do I pull a single column of data out of a filled dataset?

I have a filled dataset object, with a variety of tables. I need to get all of the data that is stored in a particular column in one of the tables, and bind a ComboBox ItemSource to it. (This may require me to pull the data out and make it into a string collection ...)

If anyone has any bright ideas, it would be very grateful!

Giffyguy
  • 20,378
  • 34
  • 97
  • 168

1 Answers1

2

I assume this is ASP.Net....slightly different for windows forms... Set the comobobox datasource to the specific table in the dataset and then set the datavalue/datatext fields to the string name of the columns that you want for the value/display text.

ComboBox1.DataSource = myDataTable.tables(0)
ComboBox1.DisplayMember = "Field Name" 'the field you want to show in combo box.
Jay
  • 2,644
  • 1
  • 30
  • 55