#region XML转dataset
        //str 是xml字符串
        public static DataTable GetResultXMLToDataTable    (string str,string Dt_Name)
        {
            DataSet xmlDs = new DataSet("ds");
            StringReader stream = null;
            XmlTextReader reader = null;
            try
            {
                using (stream = new StringReader(str))
                {
                    using (reader = new XmlTextReader(stream))
                    {
                        xmlDs.ReadXml(reader);
                        return xmlDs.Tables[Dt_Name];
                    }
                }
            }
            catch (Exception ex)
            {
               //Get Exception
            }
            finally
            {
                if (reader != null)
                    reader.Close();
                if (stream != null)
                    stream.Close();
            }
            return null;
        }

        #endregion

 

相关文章:

  • 2021-06-16
  • 2022-12-23
  • 2022-02-27
  • 2021-10-17
  • 2021-10-10
  • 2021-10-29
  • 2022-12-23
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2021-12-08
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案