Rodusa,
The easiest way to do this would be to get the contents of the DataTable
in XML, then convert that to a byte array, then convert that to the base 64
string. To get the XML, use the WriteXml method on the DataTable (this
might be new for 2.0, I can't remember, if so, then use the WriteXml method
on the DataSet that the DataTable is in). Once you have the XML, you can
convert to a byte array using one of the Encoding classes (use
UnicodeEncoding if you don't know the encodings of the XML, or another more
appropriate one if you know the encoding will always be the same). Once you
have the bytes from the encoding, getting the base 64 string is easy.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Rodusa" <rc**********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I am looking for an example of how to save a DataTable into Base64 and
vice-versa. I tried using Convert.ToBase64String(), but it says that it
cannot convert DataTable to byte[]. Any help or pointing would be
appreciated.
Thanks
Rod