Solved

Search a DataSet using SQL Select statements

Posted on 2006-06-28
2
1,521 Views
Last Modified: 2008-01-09
Please tell me if it is possible and if it is how to use SQL select statements to query a dataset.

Thank-you
0
Comment
Question by:fly412s
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17003404
It is not possible to use SQL Select statements to filter a DataSet.  The DataTable has the .Select method, but it is only simple filter expressions, such as:

   DataRow[] findRows = table.Select( "Name = 'Bob' );

Bob
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 17003423
You can Query a DataTable:

DataTable table = new DataTable();
// fill rows
DataRow[] rows = table.Select("{field} = {value}","{sortcolumn}");

the first parameter is essentially the WHERE clause, and the second (optional) parameter is the ORDER BY clause


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now