Created
August 14, 2015 14:08
-
-
Save jdowd7/255d17fad70cdda3465e to your computer and use it in GitHub Desktop.
Converts any datatable to serializable XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string ConvertDatabaseToXML(DataTable dt) | |
{ | |
System.IO.MemoryStream memory = new System.IO.MemoryStream(); | |
dt.WriteXml(memory, true); | |
memory.Seek(0, System.IO.SeekOrigin.Begin); | |
System.IO.StreamReader memReader = new System.IO.StreamReader(memory); | |
string xmlResults; | |
xmlResults = memReader.ReadToEnd(); | |
return xmlResults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment