Query a dataset
From what I've read, the dataset is used as an in memory holder for data, which can be manipulated and then reposted and resynchronized with the database.
So, how do you query the in memory dataset for complex resultsets.
http://www.queryadataset.com/dataset.aspx //A product that does the job?
Is there another way besides buying third party software to query a dataset to display data that you have locally in memory? I understand you can do simple, one table filters using a dataview object. But, this isn't good enough.
For example, Select Count(CustomerID) From Customers Where CustomerID not in ( Select CustomerID From Customer_Orders) //Uses multiple tables.
This becomes even more of a problem if you need the complex dataviews to do further edits on the datatables in the dataset. For instance, now we'd like to delete all customers without orders from our dataset.
Any help? Thanks!
[1103 byte] By [
Blast] at [2007-12-22]
Maybe you can't create customer views of data in a dataset directly, but is there a way around this?
This is my view of datasets, dataadapter:
1. Application pulls down information from database, fills datasets.
2. The application then manipulates the data in the datasets. At this point, if we want to query what customers do not have orders we must query our datasets since this is an offline application. Querying datasets is vital, as we need to get resultsets to make business decisions on adding, updating and deleteing rows in our dataset.
3. Now, based on our different dataviews and other display of data we can make changes to our dataset via windows forms.
4. Now, at some point we want to reconcile our dataset with the database, this is where concurrency comes in. So, we post our changes to the database, handle concurrency and then refill our dataset at this point to include our updated data (I believe our datasets automatically update on tableadaptor.update)
Is my concepts all awry? Maybe busioness objects is better then ms dataset?
Help, i'm dieing here!
Thanks for the reply. I understand you can do this on a single table, but what happens if you need to join tables or make complex queries like
Select CustomerID From Customers where customerID not in (Select CustomerID From Customer_Orders)
Is there a walk through you can point me to in order to join dataset tables? Thanks for your reply Ken.
Hi!
As far I know this facility is not available in .Net as yet. You have to wait for 3.
1) Pull the data using Dataset/DataAdapter from Master Database to Local Database, manipulate it and when done send back the changes to Master at the end of the day. This is old technique.
2) Use nested for loops. You should also try Find method.
3) LINQ has got what you want.
--Sohail
Yeah Linq looks good, really good. I wonder if I can just start developing using the latest CTP? The application I'm developing is a fairly small in house project...
Anyway, thank you Sohail, this is what I was looking for!