Преглед изворни кода

2005-08-09 Sureshkumar T <[email protected]>

	* OdbcParameter.cs: setBuffer (): allocate a short int buffer for
	OdbcType.SmallInt. fixes bug #75600.


svn path=/trunk/mcs/; revision=48149
Sureshkumar T пре 20 година
родитељ
комит
5f4b126c3e

+ 5 - 0
mcs/class/System.Data/System.Data.Odbc/ChangeLog

@@ -1,3 +1,8 @@
+2005-08-09  Sureshkumar T  <[email protected]>
+
+	* OdbcParameter.cs: setBuffer (): allocate a short int buffer for
+	OdbcType.SmallInt. fixes bug #75600.
+
 2005-08-08  Gert Driesen  <[email protected]>
 
 	* OdbcConnection.cs: Marked Init helper method private.

+ 3 - 1
mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs

@@ -298,7 +298,7 @@ namespace System.Data.Odbc
                         
 			// Bind parameter based on type
                         int ind = -3;
-			if (odbcType == OdbcType.Int)
+			if (odbcType == OdbcType.Int || odbcType == OdbcType.SmallInt)
                                 ret = libodbc.SQLBindParameter(hstmt, (ushort)ParamNum, (short)paramdir,
                                                                ctype, sqltype, Convert.ToUInt32(Size),
                                                                0, ref intbuf, 0, ref ind);
@@ -315,6 +315,8 @@ namespace System.Data.Odbc
 			// Load buffer with new value
 			if (odbcType == OdbcType.Int)
                                 intbuf = Value == null ? new int () : (int) Value;
+			else if (odbcType == OdbcType.SmallInt)
+				intbuf = Value == null ? new short () : Convert.ToInt16(Value);
 			else if (odbcType == OdbcType.Numeric
 				 || odbcType == OdbcType.Decimal) {
 				// for numeric, the buffer is a packed decimal struct.