Beispiel #1
0
        public void AddTable(string tableName, Dictionary <string, Type> myData)
        {
            XmlTable xmldt = new XmlTable();

            xmldt.CreateTable(tableName, myData);

            if (xmldt != null)
            {
                ListDataObjects.Add(xmldt);
                Ds.Tables.Add(xmldt.Dt);
            }
        }
Beispiel #2
0
        public void LoadXmlDb()
        {
            this.ClearData();
            if (File.Exists(DataBasePathFile))
            {
                Ds.ReadXml(DataBasePathFile);

                foreach (DataTable dt in Ds.Tables)
                {
                    XmlTable myXmlData = new XmlTable
                    {
                        TableName = dt.TableName,
                        Dt        = dt
                    };

                    foreach (DataColumn dc in dt.Columns)
                    {
                        myXmlData.Properties.Add(dc.ColumnName, dc.DataType);
                    }

                    ListDataObjects.Add(myXmlData);
                }
            }
        }