Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO.NET DataSet question

Status
Not open for further replies.

DeveloperJr

Programmer
Mar 10, 2007
25
US
Is it possible to issue a query against a data set as opposed to database. For example replace price with price * 1.1 if price is less than $50 for instance.

I want to be able to do this as a part of processing the records in the dataset before updating the database. Is there any way to do this other than iterating through the set with foreach?
 
Well, a quick Google turned up this assembly, which purports to allow you to use SQL to query a dataset. I have no experience with it, though, so I don't know how well it works.

As far as built-in capabilities, you can use DataTable.Select method and the DataView class to filter out just the records with price < 50, or whatever criteria you have. But as far as I know, there is no way to run an arbitrary query against a DataSet. The only way to update all the rows is to iterate over them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top