Ejemplo n.º 1
0
 public TypedToken(string name, CommonDbType dbType, byte precision, byte scale)
     : this(name, dbType)
 {
     this.Name      = name;
     this.DbType    = dbType;
     this.Precision = precision;
     this.Scale     = scale;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a Provider specific DbParameter object. The DbParameter is created specifically for User Defined Types
        /// </summary>
        protected override DbParameter GetDbParameterForUdt(string parameterName, CommonDbType dbType, string userDefinedName)
        {
            SqlParameter dbParam = new SqlParameter();

            dbParam.ParameterName = parameterName;

            dbParam.SqlDbType   = GetDbType(dbType);
            dbParam.UdtTypeName = userDefinedName;

            return(dbParam);
        }
Ejemplo n.º 3
0
 public TableColumn(string name, CommonDbType dbType)
     : base(name, dbType)
 {
     this.Identity = new IdentityOptions();
 }
Ejemplo n.º 4
0
 public TableColumn(string name, CommonDbType dbType, byte precision, byte scale)
     : base(name, dbType, precision, scale)
 {
     this.Identity = new IdentityOptions();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns a Provider specific DbParameter object.
 /// </summary>
 /// <param name="parameterName">The provider specific name of the parameter</param>
 /// <param name="dbType">The provider specific db type as an int</param>
 /// <param name="length">The length</param>
 protected override DbParameter GetDbParameter(string parameterName, CommonDbType dbType, int length)
 {
     return(new SqlParameter(parameterName, GetDbType(dbType), length));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Converts the CommonDbType to the System.Data.DbType
        /// </summary>
        protected internal DbType GetGenericDbType(CommonDbType dbType)
        {
            DbType val;

            switch (dbType)
            {
            case CommonDbType.UserDefinedType:
                val = DbType.Object;
                break;

            case CommonDbType.StructuredUdt:
                val = DbType.Object;
                break;

            case CommonDbType.Date:
                val = DbType.Date;
                break;

            case CommonDbType.Time:
                val = DbType.Time;
                break;

            case CommonDbType.SqlGeography:
                val = DbType.Object;
                break;

            case CommonDbType.SqlGeometry:
                val = DbType.Object;
                break;

            case CommonDbType.SqlHierarchyId:
                val = DbType.Object;
                break;

            case CommonDbType.AnsiString:
                val = DbType.AnsiString;
                break;

            case CommonDbType.AnsiStringFixedLength:
                val = DbType.AnsiStringFixedLength;
                break;

            case CommonDbType.AnsiText:
                val = DbType.String;
                break;

            case CommonDbType.Binary:
                val = DbType.Binary;
                break;

            case CommonDbType.Boolean:
                val = DbType.Boolean;
                break;

            case CommonDbType.Byte:
                val = DbType.Byte;
                break;

            case CommonDbType.Currency:
                val = DbType.Currency;
                break;

            case CommonDbType.DateTime:
                val = DbType.DateTime;
                break;

            case CommonDbType.DateTime2:
                val = DbType.DateTime2;
                break;

            case CommonDbType.DateTimeOffset:
                val = DbType.DateTimeOffset;
                break;

            case CommonDbType.Decimal:
                val = DbType.Decimal;
                break;

            case CommonDbType.Float:
                val = DbType.Single;
                break;

            case CommonDbType.Guid:
                val = DbType.Guid;
                break;

            case CommonDbType.Int16:
                val = DbType.Int16;
                break;

            case CommonDbType.Int32:
                val = DbType.Int32;
                break;

            case CommonDbType.Int64:
                val = DbType.Int64;
                break;

            case CommonDbType.Image:
                val = DbType.Binary;
                break;

            case CommonDbType.Single:
                val = DbType.Single;
                break;

            case CommonDbType.SmallDateTime:
                val = DbType.DateTime;
                break;

            case CommonDbType.SmallCurrency:
                val = DbType.Currency;
                break;

            case CommonDbType.String:
                val = DbType.String;
                break;

            case CommonDbType.StringFixedLength:
                val = DbType.StringFixedLength;
                break;

            case CommonDbType.Object:
                val = DbType.Object;
                break;

            case CommonDbType.UnicodeText:
                val = DbType.String;
                break;

            case CommonDbType.TimeStamp:
                val = DbType.Object;
                break;

            case CommonDbType.VarBinary:
                val = DbType.Binary;
                break;

            case CommonDbType.VarNumeric:
                val = DbType.Object;
                break;

            case CommonDbType.Xml:
                val = DbType.Xml;
                break;

            case CommonDbType.None:
                throw new ArgumentException("dbType was not specified", "dbType");

            default:
                throw new InvalidOperationException(string.Format("Type {0} is unknown", dbType));
            }

            return(val);
        }
 /// <summary>
 /// Returns a Provider specific DbParameter object.
 /// </summary>
 /// <param name="parameterName">The provider specific name of the parameter</param>
 /// <param name="dbType">The provider specific db type as an int</param>
 protected abstract DbParameter GetDbParameter(string parameterName, CommonDbType dbType);
 /// <summary>
 /// Returns a Provider specific DbParameter object. The DbParameter is created specifically for User Defined Types
 /// </summary>
 protected abstract DbParameter GetDbParameterForUdt(string parameterName, CommonDbType dbType, string userDefinedName);
Ejemplo n.º 9
0
 public Parameter(string name, CommonDbType dbType)
     : base(name, dbType)
 {
     this.Parameters.Add(this);
 }
Ejemplo n.º 10
0
 public Parameter(string name, CommonDbType dbType, int length)
     : base(name, dbType, length)
 {
     this.Parameters.Add(this);
 }
Ejemplo n.º 11
0
 public Parameter(string name, CommonDbType dbType, byte precision, byte scale)
     : base(name, dbType, precision, scale)
 {
     this.Parameters.Add(this);
 }
Ejemplo n.º 12
0
 public DBParam(CommonDbType dbType, string parameterName, object value)
 {
     DbType        = dbType;
     ParameterName = parameterName;
     Value         = value;
 }
Ejemplo n.º 13
0
 public TypedToken(string name, CommonDbType dbType)
     : this(name)
 {
     this.DbType = dbType;
 }
Ejemplo n.º 14
0
 public TypedToken(string name, CommonDbType dbType, int length)
     : this(name, dbType)
 {
     this.Length = length;
 }