當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。