当前位置: 首页>>代码示例>>C#>>正文


C# DatabaseVersion类代码示例

本文整理汇总了C#中DatabaseVersion的典型用法代码示例。如果您正苦于以下问题:C# DatabaseVersion类的具体用法?C# DatabaseVersion怎么用?C# DatabaseVersion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatabaseVersion类属于命名空间,在下文中一共展示了DatabaseVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Database

 public Database()
 {
     this.crmSoftware = AppGlobal.getCRMSoftwareValue(UConfig.getAppConfigValue("CRMSoftware", false));
     this.databaseVersion = AppGlobal.getDatabaseVersion(UConfig.getAppConfigValue("DatabaseVersion", false));
     this.connectionString = UConfig.getAppConfigValue("SQLConnectionString", bool.Parse(UConfig.getAppConfigValue("EncryptedCredentials", false)));
     this.connection = new SqlConnection(connectionString);
 }
开发者ID:kevinvw,项目名称:HubSpot2014,代码行数:7,代码来源:Database.cs

示例2: AConnectorBase

        public AConnectorBase()
        {
            this.hubSpotAPIKey = UConfig.getAppConfigValue("HubSpotAPIKey", bool.Parse(UConfig.getAppConfigValue("EncryptedCredentials", false)));
            this.connectionString = UConfig.getAppConfigValue("SQLConnectionString", bool.Parse(UConfig.getAppConfigValue("EncryptedCredentials", false)));
            //***** MHM Contacts – Replaced *****//
            //this.hubSpotAPIUrl = UConfig.getAppConfigValue("HubSpotURL", false) + hubSpotAPIKey;
            if (UConfig.getAppConfigValue("HubSpotContact", false) == "true")
                this.hubSpotAPIUrl = UConfig.getAppConfigValue("HubSpotContactURL", false) + hubSpotAPIKey;
            else
                this.hubSpotAPIUrl = UConfig.getAppConfigValue("HubSpotURL", false) + hubSpotAPIKey;
            //***** MHM Contacts ****************//

            this.hubSpotAPIVersion = UConfig.getAppConfigValue("HubSpotAPIVersion", false).ToLower();
            this.databaseVersion = AppGlobal.getDatabaseVersion(UConfig.getAppConfigValue("DatabaseVersion", false));
            this.sqlConnection = new SqlConnection(connectionString);
            this.debugLogPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\OLD_Log.txt";
            this.dataMaps = new Hashtable();
            this.pushPullDateTimeFormat = AppGlobal.getPushPullDateTimeFormat();
            this.timeZone = AppGlobal.getCurrentTimeZone();
            this.hubSpotMaps = new Hashtable();
            this.endpoint = new HubSpotEndpoint(hubSpotAPIVersion, hubSpotAPIKey);
            this.hubSpotTimePivot = UConfig.getAppConfigValue("HubSpotTimePivot", false);
            this.sqlBatchSize = UConfig.getAppConfigValue("SQLBatchSize", false);

            int batchSize; // need to make sure that sqlBatchSize is a valid integer
            if (Int32.TryParse(sqlBatchSize, out batchSize) == false)
            {
                sqlBatchSize = "0";
            }

            loadDataMaps();
        }
开发者ID:kevinvw,项目名称:HubSpot2014,代码行数:32,代码来源:AConnectorBase.cs

示例3: SchemaChange

 public SchemaChange(string pathToSchemaChangeFolder, DatabaseVersion version, DatabaseVersion previousVersion, SchemaManagerGlobalOptions options)
 {
     PathToSchemaChangeFolder = pathToSchemaChangeFolder;
     Version = version;
     PreviousVersion = previousVersion;
     Options = options;
 }
开发者ID:MattHoneycutt,项目名称:SchemaManager,代码行数:7,代码来源:SchemaChange.cs

示例4: BigintTests

        public void BigintTests(DatabaseVersion version)
        {
            RunDatabaseTest(version, db =>
            {
                var scanner = new DataScanner(db);
                var rows = scanner.ScanTable("BigintTests").ToList();

                Assert.AreEqual(1, rows[0].Field<long?>("A"));
                Assert.AreEqual(-125, rows[1].Field<long?>("A"));
                Assert.AreEqual(-129, rows[2].Field<long?>("A"));
                Assert.AreEqual(-130, rows[3].Field<long?>("A"));
                Assert.AreEqual(125, rows[4].Field<long?>("A"));
                Assert.AreEqual(130, rows[5].Field<long?>("A"));
                Assert.AreEqual(-32768, rows[6].Field<long?>("A"));
                Assert.AreEqual(32767, rows[7].Field<long?>("A"));
                Assert.AreEqual(null, rows[8].Field<long?>("A"));
                Assert.AreEqual(0, rows[9].Field<long?>("A"));
                Assert.AreEqual(32768, rows[10].Field<long?>("A"));
                Assert.AreEqual(8388607, rows[11].Field<long?>("A"));
                Assert.AreEqual(2147483647, rows[12].Field<long?>("A"));
                Assert.AreEqual(-8388608, rows[13].Field<long?>("A"));
                Assert.AreEqual(-8388609, rows[14].Field<long?>("A"));
                Assert.AreEqual(-2147483648, rows[15].Field<long?>("A"));
                Assert.AreEqual(9223372036854775807, rows[16].Field<long?>("A"));
                Assert.AreEqual(36028797018963967, rows[17].Field<long?>("A"));
                Assert.AreEqual(140737488355327, rows[18].Field<long?>("A"));
                Assert.AreEqual(549755813887, rows[19].Field<long?>("A"));
                Assert.AreEqual(2147483648, rows[20].Field<long?>("A"));
                Assert.AreEqual(-9223372036854775808, rows[21].Field<long?>("A"));
                Assert.AreEqual(-36028797018963967, rows[22].Field<long?>("A"));
                Assert.AreEqual(-140737488355327, rows[23].Field<long?>("A"));
                Assert.AreEqual(-549755813887, rows[24].Field<long?>("A"));
                Assert.AreEqual(-2147483648, rows[25].Field<long?>("A"));
            });
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:35,代码来源:DataTypeTests.cs

示例5: RunSetupQueries

        protected override void RunSetupQueries(SqlConnection conn, DatabaseVersion version)
        {
            // A normal heap that'll be round robin allocated among the data files.
            // As first 8 pages are stored in the IAM page header, and thus in the same
            // data file, we'll create 100 to hit multiple data files
            string query = "CREATE TABLE RoundRobinHeap (A int identity, B char(6000));";
            for (int i = 0; i < 100; i++)
                query += "INSERT INTO RoundRobinHeap DEFAULT VALUES;";
            RunQuery(query, conn);

            // Test the same with a clustered table
            query = "CREATE TABLE RoundRobinClustered (A int identity, B char(6000));";
            for (int i = 0; i < 100; i++)
                query += "INSERT INTO RoundRobinClustered DEFAULT VALUES;";
            RunQuery(query, conn);

            // Create a new filegroup, add a new data file and create a new heap on this FG
            RunQuery("ALTER DATABASE [" + conn.Database + "] ADD FILEGROUP [SecondaryFilegroup]", conn);
            RunQuery("ALTER DATABASE [" + conn.Database + "] ADD FILE ( NAME = N'SecondaryFGFile', FILENAME = N'" + Path.Combine(DataFileRootPath, conn.Database + "_SecondFG.ndf") + "' , SIZE = 3072KB , FILEGROWTH = 1024KB ) TO FILEGROUP [SecondaryFilegroup]", conn);
            query = "CREATE TABLE FGSpecificHeap (A int identity, B char(6000));";
            for (int i = 0; i < 100; i++)
                query += "INSERT INTO FGSpecificHeap DEFAULT VALUES;";
            RunQuery(query, conn);

            // Test the same with a clustered table
            query = "CREATE TABLE FGSpecificClustered (A int identity, B char(6000));";
            for (int i = 0; i < 100; i++)
                query += "INSERT INTO FGSpecificClustered DEFAULT VALUES;";
            RunQuery(query, conn);
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:30,代码来源:MultiFileTests.cs

示例6: Migrate

 public void Migrate(IEnumerable<IStep> migrationSteps, DatabaseVersion currentVersion, long? targetVersion, IScriptRunner scriptRunner, string schema, string tablespace)
 {
     if (_databaseMetadataProvider.SchemaExists(schema))
     {
         TerminateDatabase(migrationSteps.Select(m => m.BackwardScript), scriptRunner, schema);
     }
 }
开发者ID:plmwong,项目名称:soothsayer,代码行数:7,代码来源:TermMigration.cs

示例7: Sysowners

 public void Sysowners(DatabaseVersion version)
 {
     RunDatabaseTest(version, db => {
         var row = db.BaseTables.sysowners.First();
         TestHelper.GetAllPublicProperties(row);
     });
 }
开发者ID:rajeshpillai,项目名称:OrcaMDF,代码行数:7,代码来源:SmokeTests.cs

示例8: Save

 public void Save(DatabaseVersion inst)
 {
     using (FileStream fs = new FileStream("some.xml", FileMode.Create))
     {
         new XmlSerializer(typeof(DatabaseVersion)).Serialize(fs, inst);
     }
 }
开发者ID:rolfwessels,项目名称:databaseversioncontrol,代码行数:7,代码来源:XmlConfigFileLoader.cs

示例9: RunSetupQueries

 protected override void RunSetupQueries(SqlConnection conn, DatabaseVersion version)
 {
     RunQuery(@"	CREATE TABLE HeapForwardedRecord (A int, B varchar(5000))
                 INSERT INTO HeapForwardedRecord VALUES (25, REPLICATE('A', 4000))
                 INSERT INTO HeapForwardedRecord VALUES (28, REPLICATE('B', 4000))
                 UPDATE HeapForwardedRecord SET B = REPLICATE('A', 5000) WHERE A = 25", conn);
 }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:7,代码来源:ForwardedRecordTests.cs

示例10: RunSetupQueries

 protected override void RunSetupQueries(SqlConnection conn, DatabaseVersion version)
 {
     RunQuery(@"
         CREATE TABLE UniquifierTest (A int) WITH (DATA_COMPRESSION = ROW)
         CREATE CLUSTERED INDEX CX_A ON UniquifierTest (A ASC)
         INSERT INTO UniquifierTest VALUES (1), (1), (1)
         ", conn);
 }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:8,代码来源:UniquifierTests.cs

示例11: Dmv

        public void Dmv(DatabaseVersion version)
        {
            RunDatabaseTest(version, db => {
                var procedures = db.Dmvs.Procedures;

                Assert.AreEqual(1, procedures.Count());
                Assert.AreEqual("TestA", procedures.First().Name);
            });
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:9,代码来源:StoredProcedureTests.cs

示例12: NVarcharMax33

        public void NVarcharMax33(DatabaseVersion version)
        {
            RunDatabaseTest(version, db =>
            {
                var scanner = new DataScanner(db);
                var rows = scanner.ScanTable("NVarcharMaxTest33").ToList();

                Assert.AreEqual("".PadLeft(33, '\u040A'), rows[0].Field<string>("A"));
            });
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:10,代码来源:NVarcharMaxTests.cs

示例13: NText4020

        public void NText4020(DatabaseVersion version)
        {
            RunDatabaseTest(version, db =>
            {
                var scanner = new DataScanner(db);
                var rows = scanner.ScanTable("NTextTest4020").ToList();

                Assert.AreEqual("".PadLeft(4020, '\u040A'), rows[0].Field<string>("A"));
            });
        }
开发者ID:the263,项目名称:OrcaMDF,代码行数:10,代码来源:NTextTests.cs

示例14: VarBinary8040

        public void VarBinary8040(DatabaseVersion version)
        {
            RunDatabaseTest(version, db =>
            {
                var scanner = new DataScanner(db);
                var rows = scanner.ScanTable("VarBinaryTest8040").ToList();

                Assert.AreEqual(Encoding.UTF7.GetBytes("".PadLeft(8040, 'A')), rows[0].Field<byte[]>("A"));
            });
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:10,代码来源:VarBinaryTests.cs

示例15: Image65

        public void Image65(DatabaseVersion version)
        {
            RunDatabaseTest(version, db =>
            {
                var scanner = new DataScanner(db);
                var rows = scanner.ScanTable("ImageTest65").ToList();

                Assert.AreEqual(Encoding.UTF7.GetBytes("".PadLeft(65, 'A')), rows[0].Field<byte[]>("A"));
            });
        }
开发者ID:Robin--,项目名称:OrcaMDF,代码行数:10,代码来源:ImageTests.cs


注:本文中的DatabaseVersion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。