2005-04-05 Sureshkumar T <tsureshkumar@novell.com>
authorSureshkumar T <suresh@mono-cvs.ximian.com>
Tue, 5 Apr 2005 09:25:59 +0000 (09:25 -0000)
committerSureshkumar T <suresh@mono-cvs.ximian.com>
Tue, 5 Apr 2005 09:25:59 +0000 (09:25 -0000)
* OdbcParameter.cs: SqlBindParameter requires the last parameter
to be a ref.
* libodbc.cs: API change for above.

svn path=/trunk/mcs/; revision=42553

mcs/class/System.Data/System.Data.Odbc/ChangeLog
mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs
mcs/class/System.Data/System.Data.Odbc/libodbc.cs

index c097febbeed066169d69f97059dbcbfec1d68b24..09799f9086c6076fe79a18874060eb8fa0df1edc 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-05  Sureshkumar T  <tsureshkumar@novell.com>
+
+       * OdbcParameter.cs: SqlBindParameter requires the last parameter
+       to be a ref.
+       * libodbc.cs: API change for above.
+
 2005-04-04  Sureshkumar T  <tsureshkumar@novell.com>
 
        * OdbcDataReader.cs: Ignore BaseTableName & BaseColumnName
index 0024003d666c7c84878fe3ca4acd45442b1ba148..e3ef79769a1869c8bd82bc386fca0dc42674a3e0 100644 (file)
@@ -292,16 +292,15 @@ namespace System.Data.Odbc
                         SQL_TYPE   sqltype = OdbcTypeConverter.ConvertToSqlType (odbcType);
                         
                        // Bind parameter based on type
+                        int ind = -3;
                        if (odbcType == OdbcType.Int)
                                 ret = libodbc.SQLBindParameter(hstmt, (ushort)ParamNum, (short)paramdir,
                                                                ctype, sqltype, Convert.ToUInt32(Size),
-                                                               0, ref intbuf, 0, 0);
+                                                               0, ref intbuf, 0, ref ind);
                        else
                                 ret = libodbc.SQLBindParameter(hstmt, (ushort)ParamNum, (short)paramdir,
                                                                ctype, sqltype, Convert.ToUInt32(Size),
-                                                               0, buffer, 0, 0);
-
-                                
+                                                               0, buffer, buffer.Length, ref ind);
                        // Check for error condition\r
                        if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))\r
                                throw new OdbcException(new OdbcError("SQLBindParam", OdbcHandleType.Stmt, hstmt));\r
index 771dab8e5f96ae2c8a98efc2b17ed567cfb5f775..7b5c04f3fbee79c47555fdf4145006df3c37eeb1 100644 (file)
@@ -239,12 +239,12 @@ namespace System.Data.Odbc
                [DllImport("odbc32.dll")]
                internal static extern OdbcReturn SQLBindParameter(IntPtr StatementHandle, ushort ParamNum, 
                                short InputOutputType, SQL_C_TYPE ValueType, SQL_TYPE ParamType, uint ColSize, 
-                               short DecimalDigits, byte[] ParamValue, int BufLen, int StrLen);
+                               short DecimalDigits, byte[] ParamValue, int BufLen, ref int StrLen);
 
                [DllImport("odbc32.dll")]
                internal static extern OdbcReturn SQLBindParameter(IntPtr StatementHandle, ushort ParamNum, 
                                short InputOutputType, SQL_C_TYPE ValueType, SQL_TYPE ParamType, uint ColSize, 
-                               short DecimalDigits, ref int ParamValue, int BufLen, int StrLen);
+                               short DecimalDigits, ref int ParamValue, int BufLen, ref int StrLen);
 
                [DllImport("odbc32.dll")]
                internal static extern OdbcReturn SQLCancel(IntPtr StatementHandle);