Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Subsets
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01153454
Message ID:
01153505
Views:
19
Ok thanks. That's precisely what I was looking for.

>That helps me on something else but not what I'm looking for here.
>
>The Dataview doesn't allow for reducing column count or unique values (Ie., initially pull down five columns but only want the unique values from the 1st column for the filter combobox).

>
>Richard,
>
>In VS2005, you can perform the equivalent of a SELECT DISTINCT, by using one of the overloads on the new ToTable() method.
>
>For instance, let's say you have a datatable of 500 customers...20 might be in Florida, 35 in Georgia, etc. You want a unique list of states....and to throw a filter in for an example, you want a unique list of states where a certain indicator = 1.
>
>
>dtCustomerList.DefaultView.RowFilter = "CustIndicator = 1";
>DataTable dtStateList = dtCustomerList.DefaultView.ToTable(true,"State");
>
>
>The dtStateList table will now have a unique list of states from the customer list, where custIndicator = 1. Then you can bind your combobox to dtStateList.
>
>Again, check out the ToTable() method...it has several overloads that are useful.
>
>Let me know if that helps...
>Kevin
State of Florida, DCF
Previous
Reply
Map
View

Click here to load this message in the networking platform