* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
- * Copyright (c) 2002, 2004 Carlos Guzman Alvarez
+ * Copyright (c) 2002, 2005 Carlos Guzman Alvarez
* All Rights Reserved.
*/
else
{
string s = this.Charset.GetString(buffer, 0, buffer.Length);
+
if ((this.Length % this.Charset.BytesPerCharacter) == 0 &&
s.Length > this.CharCount)
{
s = s.Substring(0, this.CharCount);
}
+
this.Value = s;
}
break;
{
case DbDataType.Char:
case DbDataType.VarChar:
- case DbDataType.Guid:
this.Value = String.Empty;
break;
+ case DbDataType.Guid:
+ this.Value = Guid.Empty;
+ break;
+
case DbDataType.SmallInt:
this.Value = (short)0;
break;
return Type.GetType("System.DateTime");
case DbDataType.Binary:
+ return typeof(byte[]);
+
case DbDataType.Array:
return Type.GetType("System.Array");
return DbDataType.VarChar;
case IscCodes.SQL_SHORT:
- if (this.numericScale < 0)
+ if (this.subType == 2)
{
- if (this.subType == 2)
- {
- return DbDataType.Decimal;
- }
- else
- {
- return DbDataType.Numeric;
- }
+ return DbDataType.Decimal;
}
- else
+ else if (subType == 1)
+ {
+ return DbDataType.Numeric;
+ }
+ else
{
return DbDataType.SmallInt;
}
case IscCodes.SQL_LONG:
- if (this.numericScale < 0)
+ if (this.subType == 2)
{
- if (this.subType == 2)
- {
- return DbDataType.Decimal;
- }
- else
- {
- return DbDataType.Numeric;
- }
+ return DbDataType.Decimal;
}
- else
+ else if (subType == 1)
+ {
+ return DbDataType.Numeric;
+ }
+ else
{
return DbDataType.Integer;
}
+ case IscCodes.SQL_QUAD:
+ case IscCodes.SQL_INT64:
+ if (this.subType == 2)
+ {
+ return DbDataType.Decimal;
+ }
+ else if (subType == 1)
+ {
+ return DbDataType.Numeric;
+ }
+ else
+ {
+ return DbDataType.BigInt;
+ }
+
case IscCodes.SQL_FLOAT:
return DbDataType.Float;
case IscCodes.SQL_DOUBLE:
case IscCodes.SQL_D_FLOAT:
- if (this.numericScale < 0)
+ if (this.subType == 2)
{
- if (this.subType == 2)
- {
- return DbDataType.Decimal;
- }
- else
- {
- return DbDataType.Numeric;
- }
+ return DbDataType.Decimal;
}
- else
+ else if (subType == 1)
+ {
+ return DbDataType.Numeric;
+ }
+ else
{
return DbDataType.Double;
}
return DbDataType.Binary;
}
- case IscCodes.SQL_QUAD:
- case IscCodes.SQL_INT64:
- if (this.numericScale < 0)
- {
- if (this.subType == 2)
- {
- return DbDataType.Decimal;
- }
- else
- {
- return DbDataType.Numeric;
- }
- }
- else
- {
- return DbDataType.BigInt;
- }
-
case IscCodes.SQL_TIMESTAMP:
return DbDataType.TimeStamp;