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


C# DbmsType.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:15,代码来源:OracleConnectionProvider.cs

示例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());
 }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:21,代码来源:DbGeneratorComponentFactory.cs

示例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());
 }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:20,代码来源:DbGeneratorComponentFactory.cs


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