Recently I was in the need to serialize a DataTable as a string for further processing (storing in a file).
So I asked myself: How to serialize a DataTable into a string?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is the code I wrote to perform the task of serializing a
DataTableinto a string:Hopefully this is useful for someone somewhere out there.
(Please note that I asked in the past whether it is OK to post snippets and got replies that this should be OK; correct me if I am wrong on that – thanks!)