Solved

Search a DataSet using SQL Select statements

Posted on 2006-06-28
2
1,523 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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