public static DataSet LoadXsdText2(string xsd) { DataSet dataset = null; try { if (!String.IsNullOrEmpty(xsd)) { MemoryStream s = new MemoryStream(UStr.ToBytes(xsd)); s.Position = 0; dataset = new DataSet(); dataset.ReadXmlSchema(s); s.Close(); } } catch (Exception ex) { throw ex; } return(dataset); }
public static DataTable LoadXsdText(string xsd) { DataTable table = null; try { table = new DataTable(); if (!String.IsNullOrEmpty(xsd)) { MemoryStream s = new MemoryStream(UStr.ToBytes(xsd)); s.Position = 0; DataSet ds = new DataSet(); ds.ReadXmlSchema(s); table = ds.Tables[0]; s.Close(); } } catch (Exception ex) { throw ex; } return(table); }
public static DataSet LoadDataSet(DataSet dataset, string xml) { try { if (IsValidXml(xml)) { MemoryStream s = new MemoryStream(UStr.ToBytes(xml)); s.Position = 0; dataset.ReadXml(s); s.Close(); } } catch (Exception ex) { throw ex; } return(dataset); }
public static DataTable LoadDataTable(DataTable table, string xml) { try { if (IsValidXml(xml)) { MemoryStream s = new MemoryStream(UStr.ToBytes(xml)); s.Position = 0; table.ReadXml(s); s.Close(); } } catch (Exception ex) { throw ex; } return(table); }
public void LoadXml(string xsdPath, string xml) { try { LoadXsd(xsdPath); if (!String.IsNullOrEmpty(xml)) { MemoryStream s = new MemoryStream(UStr.ToBytes(xml)); s.Position = 0; DataTable.ReadXml(s); s.Close(); } } catch (Exception ex) { throw ex; } }