数组和datatable间的相互转换[C#]
byte[] LogMsgByte = null;
DataTable dtMessageInfo = new DataTable();
//将datatable转换为数组
dtMessageInfo.TableName = "MSGInfoName";
MemoryStream streamSaveUldByte = new MemoryStream();
dtMessageInfo.WriteXml(streamSaveUldByte, XmlWriteMode.WriteSchema);
LogMsgByte = streamSaveUldByte.ToArray();
//将数组转换为datatable
MemoryStream stream = new MemoryStream(LogMsgByte);
dtMessageInfo.ReadXml(stream);
清空回声