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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -