Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DataTable.Select() method

Posted on 2004-04-04
2
Medium Priority
?
1,368 Views
Last Modified: 2007-12-19
I have a datatable with a column named desc1. desc1 is not unique, but I would like to return an array of datarows using the select method. I've used this select expression

"desc1 = 'something'"

But that returns all the rows that have desc1 = 'something', but I want only the rows with distinct values for desc1.

like, a select distinct statement.

Is there any way to do this in the filter expression?
0
Comment
Question by:gregasm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Expert Comment

by:DonRameshSachin
ID: 10755067
Hi,
 DataTable.Select, method can handle only Expression , sorting and DataviewRowstates. U cannot use  this Select method to obtain distinct values in a batch of records.  Probably wht  u can do is that loop through The Datatable and remove the duplicated values. But the best way is to do that before filling the Datatable. I.e., change the query which u have used to fill up the datatable in such a way that select distinct values

Don
0
 
LVL 28

Accepted Solution

by:
mmarinov earned 2000 total points
ID: 10755381
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question