DataSetExtensions

48 views
Skip to first unread message

Tom Price

unread,
Jan 18, 2010, 1:54:53 PM1/18/10
to LINQBridge
How can I implement the AsEnumerable() and CopyToDataTable() extension
methods? Or is there a way I can structure my query so as to not need
them?

Thanks in advance.

Atif Aziz

unread,
Jan 18, 2010, 2:59:21 PM1/18/10
to linqb...@googlegroups.com
You'd be glad to know we just happened to be working on that in the MoreLINQ project. See the following for more:
--
You received this message because you are subscribed to the Google Groups "LINQBridge" group.
To post to this group, send email to linqb...@googlegroups.com.
To unsubscribe from this group, send email to linqbridge+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/linqbridge?hl=en.




Tom Price

unread,
Jan 20, 2010, 7:34:15 PM1/20/10
to linqb...@googlegroups.com
Thanks, Atif.

Trying to backport a 3.5 application so it will run on FW 2.0.

But, after a quick review of morelinq, I'm confused. Does this/will this provide the AsEnumerable method required to do a LINQ query against an Ado.Net dataset?

If not, is there some strategy that I could use to allow linqbridge to query these tables?

Thanks in advance.


--- On Mon, 1/18/10, Atif Aziz <aziz...@gmail.com> wrote:

Atif Aziz

unread,
Jan 21, 2010, 2:17:12 PM1/21/10
to linqb...@googlegroups.com
Hi,

Does this/will this provide the AsEnumerable method required to do a LINQ query against an Ado.Net dataset?

No, the idea of MoreLINQ is to provide operators LINQ forgot. ;) The idea of LINQBridge is certainly more to enable apps to run on .NET 2.0. Unfortunately, I completely misread your original question and may have lead down the wrong track. I didn't make the link between the subject line and the methods you mentioned. I thought you were looking for a CopyToDataTable method that copies any sequence, where T is not constrained to DataRow as in LINQ to DataSet, to a DataTable and that's what's being added to MoreLINQ. Anyway, going back to your question...

How can I implement the AsEnumerable() and CopyToDataTable() extension
methods? Or is there a way I can structure my query so as to not need
them?

Whether you are able to structure your query differently or not depends on what all features of LINQ to DataSet you're depending on. Neither method (AsEnumerable or CopyToDataTable) is all that hard to implement but it depends on the level of compatibility you're seeking. With LINQBridge, the idea was 100% coverage and backward compatibility. If you just want to run queries on a DataTable, doing a Cast<DataRow> over the Rows collection is often sufficient and LINQBridge can already help you there. As for CopyToDataTable, you might just want to have a private implementation that addresses only the features you require and then you'd be good to go.

- Atif
Reply all
Reply to author
Forward
0 new messages