Beispiel #1
0
        public static DataTable Deserialize(string tableName, DataTableJson dataTable)
        {
            DataSet dataSet = new DataSet();

            using (var xmlreader = new StringReader(dataTable.DataTable))
                dataSet.ReadXml(xmlreader);
            return(dataSet.Tables[tableName]);
        }
Beispiel #2
0
        public static DataTableJson Serialize(DataTable dataTable)
        {
            StringBuilder xmlString = new StringBuilder();

            using (var xmlWriter = XmlWriter.Create(xmlString))
                dataTable.WriteXml(xmlWriter);
            DataTableJson dataTableJson = new DataTableJson(OperationCode.AnswerOK, xmlString.ToString());

            return(dataTableJson);
        }