nareshver
asked on
Xml from DataTable
HI
I have a dataset that have two datatables in it.
and i want xml from second datatable only without writing it to file.
because i have to use that xml. so i dont want to write that in file.
I want something like exporting it into the memory and then reading fromt here.
. is there any way.
i use ds.GetXml(). but it return xml from both tables. i want from only one
I have a dataset that have two datatables in it.
and i want xml from second datatable only without writing it to file.
because i have to use that xml. so i dont want to write that in file.
I want something like exporting it into the memory and then reading fromt here.
. is there any way.
i use ds.GetXml(). but it return xml from both tables. i want from only one
u can try using Dataset.Tables.RemoveAt() method to remove the datatable from the dataset and then use GetXml() .. U can first copy your dataset prior removing the table.
Hi,
You could remove the first datatable from the dataset then use .GetXml()
e.g.
ds.Tables.RemoveAt(0);
string tableXml = ds.GetXml();
You could remove the first datatable from the dataset then use .GetXml()
e.g.
ds.Tables.RemoveAt(0);
string tableXml = ds.GetXml();
ASKER
Thanks for answers
But i need both these tables if i copy the datatable there will be performance hit.
because of unnecessary copying of the datatable.
But i need both these tables if i copy the datatable there will be performance hit.
because of unnecessary copying of the datatable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.