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

python - How to clone or copy a list? -

The SDK directory does not exist (ubuntu 16.04) (react native) -

linux - How to use Android ltrace tool to trace an app? -