Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using (StringWriter sw = new StringWriter())
                            {
                                dt.WriteXml(sw);
                                XMLOutput = sw.ToString();
                            }
Posted

1 solution

You need to set the name of the table before you serialize it:
C#
dt.TableName = "MyTable";
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900