public DAEParameter ( string name, DAEDbType type, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumnName, DataRowVersion srcVersion, object value ) { _name = name; DAEDbType = type; _size = size; _direction = direction; _isNullable = isNullable; _precision = precision; _scale = scale; SourceColumn = sourceColumnName; _sourceVersion = srcVersion; _value = value; }
private void Initialize(string name, DAEDbType type, ParameterDirection direction, bool isNullable, string sourceColumn) { _name = name; DAEDbType = type; _direction = direction; _isNullable = isNullable; SourceColumn = sourceColumn; }
/// <summary> Maps a DAEDbType to a DBType. </summary> private DbType DbTypeFromDAEDbType(DAEDbType dAEDbType) { switch (dAEDbType) { case DAEDbType.Boolean: return(DbType.Boolean); case DAEDbType.Byte: return(DbType.Byte); case DAEDbType.DateTime: return(DbType.DateTime); case DAEDbType.Decimal: return(DbType.Decimal); //Double is not supported by the DAE, doubles are treated as decimals. case DAEDbType.GUID: return(DbType.Guid); case DAEDbType.Integer: return(DbType.Int32); case DAEDbType.Long: return(DbType.Int64); case DAEDbType.Short: return(DbType.Int16); case DAEDbType.Money: return(DbType.Currency); #if UseUnsignedIntegers case DAEDbType.PByte: return(DbType.Byte); case DAEDbType.PShort: return(DbType.UInt16); case DAEDbType.PInteger: return(DbType.UInt32); case DAEDbType.PLong: return(DbType.UInt64); case DAEDbType.SByte: return(DbType.SByte); case DAEDbType.UShort: return(DbType.UInt16); case DAEDbType.UInteger: return(DbType.UInt32); case DAEDbType.ULong: return(DbType.UInt64); #endif case DAEDbType.String: return(DbType.String); case DAEDbType.TimeSpan: return(DbType.Int64); case DAEDbType.Raw: return(DbType.Binary); default: return(DbType.Binary); } }
/// <summary> Maps a DAEDbType to an Dataphor Schema.DataType </summary> public static Schema.IDataType DataTypeFromDAEDbType(DAEDbType dAEDbType, DAEConnection connection) { switch (dAEDbType) { case DAEDbType.String: return(connection.ServerProcess.DataTypes.SystemString); case DAEDbType.Boolean: return(connection.ServerProcess.DataTypes.SystemBoolean); case DAEDbType.Byte: return(connection.ServerProcess.DataTypes.SystemByte); case DAEDbType.Short: return(connection.ServerProcess.DataTypes.SystemShort); case DAEDbType.Integer: return(connection.ServerProcess.DataTypes.SystemInteger); case DAEDbType.Long: return(connection.ServerProcess.DataTypes.SystemLong); case DAEDbType.Decimal: return(connection.ServerProcess.DataTypes.SystemDecimal); case DAEDbType.GUID: return(connection.ServerProcess.DataTypes.SystemGuid); case DAEDbType.Money: return(connection.ServerProcess.DataTypes.SystemMoney); #if UseUnsignedIntegers case DAEDbType.PByte: return(AConnection.ServerProcess.DataTypes.SystemPByte); case DAEDbType.PShort: return(AConnection.ServerProcess.DataTypes.SystemPShort); case DAEDbType.PInteger: return(AConnection.ServerProcess.DataTypes.SystemPInteger); case DAEDbType.PLong: return(AConnection.ServerProcess.DataTypes.SystemPLong case DAEDbType.SByte: return AConnection.ServerProcess.DataTypes.SystemSByte); case DAEDbType.UInteger: return(AConnection.ServerProcess.DataTypes.SystemUInteger); case DAEDbType.ULong: return(AConnection.ServerProcess.DataTypes.SystemULong); case DAEDbType.UShort: return(AConnection.ServerProcess.DataTypes.SystemUShort); #endif case DAEDbType.TimeSpan: return(connection.ServerProcess.DataTypes.SystemTimeSpan); case DAEDbType.DateTime: return(connection.ServerProcess.DataTypes.SystemDateTime); case DAEDbType.Raw: return(connection.ServerProcess.DataTypes.SystemBinary); default: return(connection.ServerProcess.DataTypes.SystemBinary); } }
public DAEParameter(string name, DAEDbType type, ParameterDirection direction) { Initialize(name, type, direction, true, String.Empty); }
public DAEParameter(string name, DAEDbType type, string sourceColumnName) { Initialize(name, type, ParameterDirection.Input, true, sourceColumnName); }
public int Add(string parameterName, DAEDbType type, string sourceColumnName) { return(Add(new DAEParameter(parameterName, type, sourceColumnName))); }
public int Add(string parameterName, DAEDbType type) { return(Add(new DAEParameter(parameterName, type))); }