Hi
I'm having some problems getting a dynamic LINQ query to work on my DataSet. The idea is that a user selects certain criteria, and then the LINQ query filters through the dataset making the requested changes.
The table I am trying to alter is called RawData, this is defined in a DataSet but has no data columns as these aren't known until some data is imported. As part of my import routine it automatically creates...
User Profile
Collapse
-
Dynamic LINQ on DataSet
-
Just a quick thought, are you removing the surround tag elements from your string before you try to parse it?... -
Solution
It was actually a silly mistake on my part (though didn't find reference to it anywhere!). I forgot a using statement, in the end code looked like below.
Code:using System.Linq; DataAccess.RawDataDS ds = DataAccess.RawDataDSManagement.RawData; DataTable demoCriteria = ds.Tables["DemographicCriteria"]; IEnumerable<string> query = (from row in demoCriteria.AsEnumerable()
Leave a comment:
-
Thanks for your quick response. I have tried that though C# doesn't seem to accept distinct as a keyword and throws a compile time error....Leave a comment:
-
Distinct rows from DataSet using LINQ
Hi all,
I am having some problems using LINQ to access Distinct records from a Dataset. I have looked around and believe it should be as simple as addedCode:.Distinct()
My DataSet has multiple tables, all populated with data. I have a table called DemographicCrit eria which has the fields listed below.
- CriteriaID
- DemographicCode
- In
No activity results to display
Show More
Leave a comment: