Exemple #1
0
        public void CreateTable(string dataDbPath, string tableName)
        {
            //ADOX.Column[] columns = {
            //                                new ADOX.Column(){Name="ID",Type=ADOX.DataTypeEnum.adInteger,DefinedSize=0},
            //                                     new ADOX.Column(){Name="CurrentMileage",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0},
            //                                     new ADOX.Column(){Name="CurrentSample",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0},
            //                                     new ADOX.Column(){Name="LastMileage",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0},
            //                                     new ADOX.Column(){Name="LastSample",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0},
            //                                     new ADOX.Column(){Name="DiffSample",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0},
            //                                     new ADOX.Column(){Name="DiffMileage",Type=ADOX.DataTypeEnum.adDouble,DefinedSize=0}
            //                                 };


            //DataAccess.AccessHelper.CreateAccessTable(dataDbPath, tableName, columns);
            //DbOperator d = new DbOperator();
            IOperator dbopertor = new DbOperator();

            dbopertor.DbFilePath = dataDbPath;
            string cmd = "create table " + tableName + "(ID long,CurrentMileage float,CurrentSample float,LastMileage float,LastSample float,DiffSample float,DiffMileage float)";

            dbopertor.CheckAndCreateTable(tableName, cmd);
        }