Click here to Skip to main content
14,660,427 members
Rate this:
Please Sign up or sign in to vote.
See more:
using (StringWriter sw = new StringWriter())
                            {
                                dt.WriteXml(sw);
                                XMLOutput = sw.ToString();
                            }
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You need to set the name of the table before you serialize it:
dt.TableName = "MyTable";
   
Comments
raxhemanth 8-Jan-16 8:19am
   
Thankyou!
Maciej Los 8-Jan-16 10:53am
   
Tomas, are you a soothsayer?
Based on this piece of code i wouldn't be able to guess what @rezhemanth is going to achieve.
A 5!
Tomas Takac 8-Jan-16 15:05pm
   
Thanks Maciej! :)
BillWoodruff 8-Jan-16 16:04pm
   
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100