开发者

How can I write Join statements on dataset

How can I write Join statements on dataset.. I开发者_StackOverflow社区 have data in xml format..I can load that data into a dataset.. but how do I fetch data from two datatables using a join query?


Well, it partly depends on how you want to express that join. If you know the query beforehand, I would personally use LINQ to Objects via LINQ to DataSet - that's particularly handy if you're working with strongly typed datasets, but it can work even without that.

The sample code for C# in Depth has some examples in LINQ to DataSet you could have a look at.

Now, if you want to read the query dynamically as well, that makes it a lot harder.

Is this XML actually an XML-serialized dataset? Do you definitely need to get datasets involved at all? If it's just plain XML, have you tried using LINQ to XML with LINQ to Objects? It may be less efficient, but how vital is that for your application? How large is the data likely to be?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜