Distinct Items in a Dropdown List from DataSet

  • Thread starter Thread starter Seelan
  • Start date Start date
S

Seelan

Hey Guys,
I have read a table from SQL Server to a Dataset called ds. Now I want
to list the items of one column to a DropDown List...I can do this perfectly
but i want ht e list to contain DISTINCT items without having to call the
SQLCommand again!
Please help thanks!
Seelan-
 
You should create a DataView on the table (or just use the default view) and
use the row filter to only show distinct values. Then bind your control to
the View.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
Eric?
Can u please explain me briefly how to do it...Im kind of a newbie with
this..may be code examples?
 
Sorry, after sitting down to do it, I remembered that the DataTable or
DataView can not filter itself to only distinct records. Here's a KB
article on how to do it with helper methods:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q325684


--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
Back
Top