Encrypting a datatable

  • Thread starter Thread starter John Wright
  • Start date Start date
J

John Wright

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
 
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
 
Wow that is simple. Thanks.

John
Cor Ligthert said:
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
 
Back
Top