-
[RESOLVED] [1.0/1.1]
Having problem with DataSet populated from MS Access db. It is generated from Union query and can contain not unique records, e.g. query result:
ID Amount
10 25
11 30
10 25
15 40
…
Dataset simply deletes repeated record, so in the dataset records presented as:
ID Amount
10 25
11 30
15 40
…
Because dataset populated from two quite similar tables, the uniqueness of records cannot be guaranteed (including more fields in the result query cannot it provide as well).
One solution can be: get two datasets from the both tables and add records from the second dataset to the first one, setting datarow ‘ID’ to some unique number. But I am wondering, is there any properties in a dataset object which will allow to keep all records, or may be there is some other simple way to solve this problem?
-
Re: [1.0/1.1]
DataSets don't simply delete records. The DataSet will contain whatever records your query returns. If you aren't getting the result you want then you're query is flawed.
-
Re: [1.0/1.1]
Thanks for your suggestion. The problem was in union query, I missed keyword ALL which should be put after UNION, so the query did not return all rows. After using UNION ALL everything fixed.
-
Re: [1.0/1.1]
Please mark this thread resolved from the Thread Tools menu above the first post. :)