本文整理汇总了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);
}
示例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();
}
示例3: SchemaChange
public SchemaChange(string pathToSchemaChangeFolder, DatabaseVersion version, DatabaseVersion previousVersion, SchemaManagerGlobalOptions options)
{
PathToSchemaChangeFolder = pathToSchemaChangeFolder;
Version = version;
PreviousVersion = previousVersion;
Options = options;
}
示例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"));
});
}
示例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);
}
示例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);
}
}
示例7: Sysowners
public void Sysowners(DatabaseVersion version)
{
RunDatabaseTest(version, db => {
var row = db.BaseTables.sysowners.First();
TestHelper.GetAllPublicProperties(row);
});
}
示例8: Save
public void Save(DatabaseVersion inst)
{
using (FileStream fs = new FileStream("some.xml", FileMode.Create))
{
new XmlSerializer(typeof(DatabaseVersion)).Serialize(fs, inst);
}
}
示例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);
}
示例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);
}
示例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);
});
}
示例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"));
});
}
示例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"));
});
}
示例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"));
});
}
示例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"));
});
}