c# - How to serialize dataRow to xml and get bytes array? -


how serialize single datarow xml , byte array? best way serialize data row xml? should create class, set value datarow class object , serialize bytes? better way?

try following :

        static void main(string[] args)         {             datatable dt = new datatable();              memorystream stream = new memorystream();              dt.writexml(stream);              stream.position = 0;              byte[] bytes = new byte[stream.length];             stream.read(bytes, 0, (int)stream.length);           } 

Comments

Popular posts from this blog

string - Using python and postgres, variables within execute function? -

git - TortoiseGit does not show commit log properly -