views:

42

answers:

4

The more and more I use the LINQ the more and more I really enjoy it, and it's syntax. I do a lot of data comparisons on a day to day basis. What I would really enjoy is a tool that allows me to load a DataSet, and then query that DataSet at runtime with LINQ queries. I primarily just want a tool, and to be able to load my DataSets dynamically.

Does something like this exist? I don't think LINQ was originally intended for this type of use, but I feel like it would be a powerful tool to have if it existed.

+5  A: 

It's not entirely clear what you mean to be honest... but LINQPad allows you to load data and then query it.

Strongly-typed datasets are already easy to query with LINQ; weakly typed ones are a bit more of a pain, but LINQ to DataSet makes it easier than it would be otherwise.

Jon Skeet
Sorry, my terminology is not always the best. It looks like LINQPad is probably what I was asking for. How could I have asked it better?
jsmith
w00t w00t for LinqPad. Essential toolage.
spender
@jsmith: You could have made it clear whether you wanted to load the *dataset* dynamically but use a pre-canned query, and whether this needed to be code within your own app or whether you were just looking for a tool.
Jon Skeet
+1  A: 

Sure, the tool is called DataTable.AsEnumerable().

mquander
Sorry, I must have asked the question wrong. This answer is probably right because of my terminology, but nonetheless, your answer feels like sarcasm.
jsmith
Sorry right back, I guess I just didn't understand. LINQPad doesn't really have anything to do with `DataSets` in particular.
mquander
+3  A: 

You should check out LinqPad http://www.linqpad.net/

TheNextman
A: 

You can use LINQ with the specification/filter pattern to create dynamically generated queries. There's a LINQ-to-SQL and LINQ-to-NHibernate implementation on Github.

Jarrett Meyer