I have a Linq List in which have data more than one tables and these tables has related to each other. in this list it has some another table list property. Like table1 and table2 has related to each other and we have a data in list of table1 and in this list it has automatically table2 data.
Now i want to convert this List into a XML but it throws an error i.e. circular reference error, So now i want to convert this list into a dataset and by using this dataset i can generate a xml.
So can anyone provide us code to generate multiple tables dataset from a List….
or
convert list to xml code….
or
any other helpful comments…………
You really haven’t given a lot of information to work with, but I’ll take a stab at a basic answer.
Given this class structure:
I can create this list:
Now, I might want to convert this into XML that looks like this:
Here’s the LINQ code that does it:
Is that the kind of thing that you wanted?