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

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -