本文整理汇总了C#中DbmsType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DbmsType.ToString方法的具体用法?C# DbmsType.ToString怎么用?C# DbmsType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbmsType
的用法示例。
在下文中一共展示了DbmsType.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OracleConnectionProvider
/// <summary>
/// Constructor. Sets DBMS type and connection string.
/// </summary>
/// <param name="dbmsType">DBMS type to which this provider connects to. Only Oracle compatibile values are allowed.</param>
/// <param name="connectionString">Connection string.</param>
public OracleConnectionProvider(DbmsType dbmsType, string connectionString)
{
if (connectionString == null)
throw new ArgumentNullException("connectionString", Messages.ConnectionProvider_ConnectionStringMayNotBeNull);
if (!IsSupportedDbms(dbmsType))
throw new ArgumentException(Messages.ConnectionProvider_UnsupportedDbmsType + dbmsType.ToString(), "dbmsType");
this.rdbms = dbmsType;
this.oraConn = new OracleConnection(connectionString);
}
示例2: GetMetadataSource
/// <summary>Creates medata source.</summary>
/// <param name="dbms">One of the supported RDBMSs: SQL Servler, Oracle, SQL Server CE, PostgreSQL, MySQL.</param>
/// <param name="connString">Connection string.</param>
/// <returns>Database metada source.</returns>
public static IMetadataSource GetMetadataSource(DbmsType dbms, string connString)
{
if (DbGeneratorComponentFactory.IsSqlServer(dbms))
return new SqlServerMetadataSource(dbms, connString);
else if (DbGeneratorComponentFactory.IsOracle(dbms))
return new OracleMetadataSource(dbms, connString);
else if (DbGeneratorComponentFactory.IsSqlCe(dbms))
return new SqlServerCeMetadataSource(dbms, connString);
else if (DbGeneratorComponentFactory.IsPostgreSql(dbms))
return new PostgreSqlMetadataSource(dbms, connString);
else if (DbGeneratorComponentFactory.IsMySql(dbms))
return new MySqlMetadataSource(dbms, connString);
else if (DbGeneratorComponentFactory.IsFirebird(dbms))
return new FirebirdMetadataSource(dbms, connString);
else
throw new ArgumentOutOfRangeException("dbms", "Unsupported DBMS type: " + dbms.ToString());
}
示例3: GetTypeMappers
/// <summary>Get object that map native to target datatypes implemented for the specified DBMS.</summary>
/// <param name="dbms">One of the supported RDBMSs: SQL Servler, Oracle, SQL Server CE, PostgreSQL, MySQL.</param>
/// <returns>A collection od mappers implemented for specified DBMS. Contains at least one element.</returns>
public static IEnumerable<ITypeMapper> GetTypeMappers(DbmsType dbms)
{
if (DbGeneratorComponentFactory.IsSqlServer(dbms))
return new ITypeMapper[] { new TsqlToCsharp2TypeMapper(), new TsqlToCsharpNullableTypesMapper() };
else if (DbGeneratorComponentFactory.IsOracle(dbms))
return new ITypeMapper[] { new OracleToCsharp2TypeMapper() };
else if (DbGeneratorComponentFactory.IsSqlCe(dbms))
return new ITypeMapper[] { new TsqlToCsharp2TypeMapper() };
else if (DbGeneratorComponentFactory.IsPostgreSql(dbms))
return new ITypeMapper[] { new PostgreSqlToCsharp2TypeMapper() };
else if (DbGeneratorComponentFactory.IsMySql(dbms))
return new ITypeMapper[] { new MySqlToCsharp2TypeMapper() };
else if (DbGeneratorComponentFactory.IsFirebird(dbms))
return new ITypeMapper[] { new FirebirdTypeMapper() };
else
throw new ArgumentOutOfRangeException("dbms", "Unsupported DBMS type: " + dbms.ToString());
}