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();;
        }

 

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-09-02
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-17
  • 2021-12-06
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案