views:

38

answers:

1

How can I write Join statements on dataset.. I 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

A: 

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?

Jon Skeet
yes it is a validate and serialized xml data which also includes schema (xsd) in it..and yes may be I would require to build a dynamic query..
Preetham