static public DataSet DataSetFromString(string s) { if (string.IsNullOrEmpty(s)) { return null; } byte[] bytes = Encoding.UTF8.GetBytes(s); Stream inStream = null; DataSet ds = new DataSet(); try { inStream = new MemoryStream(bytes); ds.ReadXml(inStream); } finally { inStream.Close(); } return ds; } static public string GetStringFromTable(DataSet ds) { XmlDataDocument doc = new XmlDataDocument(ds); return ds.GetXml();; }