Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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;
            }
        }