By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,251 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,251 IT Pros & Developers. It's quick & easy.

Encrypting a datatable

P: n/a
I need to covert a datatable to a string so I can pass it into my encryption
engine. I need to know how to write the xml for a dataset into a string
variable so I can pass the string into the encryption engine. I don't want
to persist the data on disk, I want to be able to do this in memory so I can
discard the string variable when I am done. The engine in use here will only
accept strings for encryption.
John Wright
Jul 3 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
John,

It is in this message converted from VB so watch simple errors

'Serialize
System.IO.StringWriter sw = new System.IO.StringWriter();
MyDataset.WriteXml(sw);
string mystring = sw.ToString();
''''''''''''''''''''''''''''''''''''''
'Deserialize
System.IO.StringReader sr = new System.IO.StringReader(mystring);
DataSet ds2 = new DataSet();
ds2.ReadXml(sr);

I thought that this was very simple?

Cor
"John Wright" <ri***********@hotmail.comschreef in bericht
news:OU**************@TK2MSFTNGP03.phx.gbl...
>I need to covert a datatable to a string so I can pass it into my
encryption engine. I need to know how to write the xml for a dataset into
a string variable so I can pass the string into the encryption engine. I
don't want to persist the data on disk, I want to be able to do this in
memory so I can discard the string variable when I am done. The engine in
use here will only accept strings for encryption.
John Wright

Jul 3 '07 #2

P: n/a
Doh,

I thought I was in the C# newsgroup

http://www.vb-tips.com/dbpages.aspx?...a-c891846eaf0b

Sorry

Cor

"John Wright" <ri***********@hotmail.comschreef in bericht
news:OU**************@TK2MSFTNGP03.phx.gbl...
>I need to covert a datatable to a string so I can pass it into my
encryption engine. I need to know how to write the xml for a dataset into
a string variable so I can pass the string into the encryption engine. I
don't want to persist the data on disk, I want to be able to do this in
memory so I can discard the string variable when I am done. The engine in
use here will only accept strings for encryption.
John Wright

Jul 3 '07 #3

P: n/a
Wow that is simple. Thanks.

John
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:ur**************@TK2MSFTNGP03.phx.gbl...
John,

It is in this message converted from VB so watch simple errors

'Serialize
System.IO.StringWriter sw = new System.IO.StringWriter();
MyDataset.WriteXml(sw);
string mystring = sw.ToString();
''''''''''''''''''''''''''''''''''''''
'Deserialize
System.IO.StringReader sr = new System.IO.StringReader(mystring);
DataSet ds2 = new DataSet();
ds2.ReadXml(sr);

I thought that this was very simple?

Cor
"John Wright" <ri***********@hotmail.comschreef in bericht
news:OU**************@TK2MSFTNGP03.phx.gbl...
>>I need to covert a datatable to a string so I can pass it into my
encryption engine. I need to know how to write the xml for a dataset into
a string variable so I can pass the string into the encryption engine. I
don't want to persist the data on disk, I want to be able to do this in
memory so I can discard the string variable when I am done. The engine in
use here will only accept strings for encryption.
John Wright


Jul 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.