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


C# SqlTypes.SqlType类代码示例

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


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

示例1: SetParameterSizes

		// Used from SqlServerCeDriver as well
		public static void SetParameterSizes(IDataParameterCollection parameters, SqlType[] parameterTypes)
		{
			for (int i = 0; i < parameters.Count; i++)
			{
				SetVariableLengthParameterSize((IDbDataParameter) parameters[i], parameterTypes[i]);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:SqlClientDriver.cs

示例2: SetDefaultParameterSize

        private static void SetDefaultParameterSize(IDbDataParameter dbParam, SqlType sqlType)
        {
            switch (dbParam.DbType)
            {
                case DbType.AnsiString:
                case DbType.AnsiStringFixedLength:
                    dbParam.Size = MaxAnsiStringSize;
                    break;

                case DbType.Binary:
                    if (sqlType is BinaryBlobSqlType)
                    {
                        dbParam.Size = MaxBinaryBlobSize;
                    }
                    else
                    {
                        dbParam.Size = MaxBinarySize;
                    }
                    break;
                case DbType.Decimal:
                    dbParam.Precision = MaxPrecision;
                    dbParam.Scale = MaxScale;
                    break;
                case DbType.String:
                case DbType.StringFixedLength:
                    dbParam.Size = IsText(dbParam, sqlType) ? MaxStringClobSize : MaxStringSize;
                    break;
                case DbType.DateTime2:
                    dbParam.Size = MaxDateTime2;
                    break;
                case DbType.DateTimeOffset:
                    dbParam.Size = MaxDateTimeOffset;
                    break;
            }
        }
开发者ID:ogvolkov,项目名称:NHibernate.MvcMini,代码行数:35,代码来源:ProfiledSqlClientDriver.cs

示例3: InitializeParameter

 protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
 {
     if (sqlType is NpgsqlExtendedSqlType && dbParam is NpgsqlParameter)
         this.InitializeParameter(dbParam as NpgsqlParameter, name, sqlType as NpgsqlExtendedSqlType);
     else
         base.InitializeParameter(dbParam, name, sqlType);
 }
开发者ID:Vitala,项目名称:NCore,代码行数:7,代码来源:NpgsqlDriverExtended.cs

示例4: GetTypeName

		public override string GetTypeName(SqlType sqlType)
		{
			if (IsUnallowedDecimal(sqlType.DbType, sqlType.Precision))
				return base.GetTypeName(new SqlType(sqlType.DbType, MAX_DECIMAL_PRECISION, sqlType.Scale));

			return base.GetTypeName(sqlType);
		}
开发者ID:KaraokeStu,项目名称:nhibernate-core,代码行数:7,代码来源:FirebirdDialect.cs

示例5: InitializeParameter

		protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
		{
			var convertedSqlType = sqlType;
			if (convertedSqlType.DbType == DbType.Currency)
				convertedSqlType = new SqlType(DbType.Decimal);

			base.InitializeParameter(dbParam, name, convertedSqlType);
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:8,代码来源:FirebirdClientDriver.cs

示例6: GenerateCommand

		public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
		{
			IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes);

			SetParameterSizes(command.Parameters, parameterTypes);

			return command;
		}
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:8,代码来源:OdbcDriver.cs

示例7: InitializeParameter

 protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
 {
     base.InitializeParameter(dbParam, name, sqlType);
     if (sqlType is StringClobSqlType)
     {
         ((OracleParameter)dbParam).OracleType = OracleType.NClob;
     }
 }
开发者ID:gorbach,项目名称:NHibernateSandbox,代码行数:8,代码来源:CustomOracleDriver.cs

示例8: InitializeParameter

        protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
        {
            base.InitializeParameter(dbParam, name, sqlType);

            if (sqlType.LengthDefined)
            {
                dbParam.Size = sqlType.Length;
            }
        }
开发者ID:vladimir-goncharov,项目名称:always-encrypted-with-nhibernate,代码行数:9,代码来源:SizeAwareSqlClientDriver.cs

示例9: AddWhereFragment

		public SqlDeleteBuilder AddWhereFragment(string columnName, SqlType type, string op)
		{
			if (!string.IsNullOrEmpty(columnName))
			{
				whereStrings.Add(ToWhereString(columnName, op));
				parameterTypes.Add(type);
			}
			return this;
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:9,代码来源:SqlDeleteBuilder.cs

示例10: GenerateCommand

		public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
		{
			IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes);
			if (IsPrepareSqlEnabled)
			{
				SetParameterSizes(command.Parameters, parameterTypes);
			}
			return command;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:9,代码来源:OdbcDriver.cs

示例11: GenerateCommand

        public IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
        {
            var innerCommand = _innerDriver.GenerateCommand(type, sqlString, parameterTypes);
            if (innerCommand is GlimpseProfileDbCommand)
                return innerCommand;

            var command = new GlimpseProfileDbCommand(innerCommand as DbCommand, _stats);
            return command;
        }
开发者ID:remcoros,项目名称:Glimpse,代码行数:9,代码来源:GlimpseProfileDbDriverNh300.cs

示例12: AdjustSqlType

 private static SqlType AdjustSqlType(SqlType sqlType)
 {
     switch (sqlType.DbType)
     {
         case DbType.Guid:
             return GuidSqlType;
         default:
             return sqlType;
     }
 }
开发者ID:EamonHetherton,项目名称:nhibernate-core,代码行数:10,代码来源:OracleClientDriver.cs

示例13: GenerateCommand

		public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
		{
			IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes);
			if (prepareSql)
			{
				SqlClientDriver.SetParameterSizes(command.Parameters, parameterTypes);
			}

			return command;
		}
开发者ID:nkmajeti,项目名称:nhibernate,代码行数:10,代码来源:SqlServerCeDriver.cs

示例14: InitializeParameter

		/// <remarks>
		/// This adds logic to ensure that a DbType.Boolean parameter is not created since
		/// ODP.NET doesn't support it.
		/// </remarks>
		protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
		{
			// if the parameter coming in contains a boolean then we need to convert it 
			// to another type since ODP.NET doesn't support DbType.Boolean
			if (sqlType.DbType == DbType.Boolean)
			{
				sqlType = SqlTypeFactory.Int16;
			}
			base.InitializeParameter(dbParam, name, sqlType);
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:14,代码来源:OracleLiteDataClientDriver.cs

示例15: Generate

		public IDbCommand Generate(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
		{
			IDbCommand cmd = factory.ConnectionProvider.Driver.GenerateCommand(type, sqlString, parameterTypes);
			LogOpenPreparedCommand();
			if (log.IsDebugEnabled)
			{
				log.Debug("Building an IDbCommand object for the SqlString: " + sqlString.ToString());
			}
			commandsToClose.Add(cmd);
			return cmd;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:11,代码来源:BatcherImpl.cs


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