Ejemplo n.º 1
0
        private static void NewMethod()
        {
            DataSet ds = new DataSet("XYZ");

            {
                try
                {
                    BranchType o = new BranchType(@"D:\TEMP\SQLite\BranchTypeXYZ.xml");
                    if (o.Rows.Count == 0)
                    {
                        o.CreateBuiltInDataValues();
                        o.WriteXml();
                    }
                    ds.Tables.Add(o);
                }
                catch (System.Data.ConstraintException ex)
                {
                }
                try
                {
                    Config o = new Config(@"D:\TEMP\SQLite\ConfigXYZ.xml");
                    if (o.Rows.Count == 0)
                    {
                        o.CreateBuiltInDataValues();
                        o.WriteXml();
                    }
                    ds.Tables.Add(o);
                }
                catch (System.Data.ConstraintException ex)
                {
                }
                try
                {
                    SyntaxProviderType o = new SyntaxProviderType(@"D:\TEMP\SQLite\SyntaxProviderTypeXYZ.xml");
                    if (o.Rows.Count == 0)
                    {
                        o.CreateBuiltInDataValues();
                        o.WriteXml();
                    }
                    ds.Tables.Add(o);
                }
                catch (System.Data.ConstraintException ex)
                {
                }
                try
                {
                    DataStore o = new DataStore(@"D:\TEMP\SQLite\DataStoreXYZ.xml");
                    if (o.Rows.Count == 0)
                    {
                        o.CreateBuiltInDataValues();
                        o.WriteXml();
                    }
                    ds.Tables.Add(o);
                }
                catch (System.Data.ConstraintException ex)
                {
                }
            }
            ds.WriteXml(@"D:\TEMP\SQLite\DataSetXYZ.xml", XmlWriteMode.WriteSchema);
        }
Ejemplo n.º 2
0
 //
 public TreeDataSet(string syntaxProviderTypeFileFullPathName, string branchTypeFileFullPathName, string configFileFullPathName, string dataStoreFileFullPathName)
 {
     this.SyntaxProviderTypeFileFullPathName = syntaxProviderTypeFileFullPathName;
     this.BranchTypeFileFullPathName         = branchTypeFileFullPathName;
     this.ConfigFileFullPathName             = configFileFullPathName;
     this.DataStoreFileFullPathName          = dataStoreFileFullPathName;
     try
     {
         this._sptTbl = new SyntaxProviderType(this.SyntaxProviderTypeFileFullPathName);
         if (this._sptTbl.Rows.Count == 0)
         {
             this._sptTbl.CreateBuiltInDataValues();
             this._sptTbl.WriteXml();
         }
     }
     catch (System.Data.ConstraintException ex)
     {
     }
     try
     {
         this._bt = new BranchType(this.BranchTypeFileFullPathName);
         if (this._bt.Rows.Count == 0)
         {
             this._bt.CreateBuiltInDataValues();
             this._bt.WriteXml();
         }
     }
     catch (System.Data.ConstraintException ex)
     {
     }
     try
     {
         this._cfgTbl = new Config(this.ConfigFileFullPathName);
         if (this._cfgTbl.Rows.Count == 0)
         {
             this._cfgTbl.CreateBuiltInDataValues();
             this._cfgTbl.WriteXml();
         }
     }
     catch (System.Data.ConstraintException ex)
     {
     }
     try
     {
         this._dsTbl = new DataStore(this.DataStoreFileFullPathName);
         if (this._dsTbl.Rows.Count == 0)
         {
             this._dsTbl.CreateBuiltInDataValues();
             this._dsTbl.WriteXml();
         }
     }
     catch (System.Data.ConstraintException ex)
     {
     }
 }