소스 검색

2004-08-26 Sureshkumar T ([email protected])
* OdbcDataReader.cs - Date & DateTime GetValue fixed.
GetBytes ordinal parameter passing fixed for BINARY in GetValue.

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

Sureshkumar T 21 년 전
부모
커밋
c477b47d09
2개의 변경된 파일15개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 0
      mcs/class/System.Data/System.Data.Odbc/ChangeLog
  2. 11 2
      mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs

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

@@ -1,3 +1,7 @@
+2004-08-26 Sureshkumar T ([email protected])
+	* OdbcDataReader.cs - Date & DateTime GetValue fixed. 
+			      GetBytes ordinal parameter passing fixed for BINARY in GetValue.
+
 2004-08-20 Sureshkumar T ([email protected])
 	* OdbcConnection.cs - correct handles are passed to OdbcError exception to trap the correct error
 

+ 11 - 2
mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs

@@ -519,8 +519,17 @@ namespace System.Data.Odbc
 						break;
 					case OdbcType.Timestamp:
 					case OdbcType.DateTime:
+					case OdbcType.Date:
+					case OdbcType.Time:
 						OdbcTimestamp ts_data=new OdbcTimestamp();
-						ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.DateTime, ref ts_data, 0, ref outsize);
+						if (col.OdbcType == OdbcType.Timestamp) 
+							ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Timestamp, ref ts_data, 0, ref outsize);
+						else if (col.OdbcType == OdbcType.DateTime)
+							ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.DateTime, ref ts_data, 0, ref outsize);
+						else if (col.OdbcType == OdbcType.Date)
+							ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Date, ref ts_data, 0, ref outsize);
+						else  // FIXME: how to get TIME datatype ??
+							ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.DateTime, ref ts_data, 0, ref outsize);
 						if (outsize!=-1) // This means SQL_NULL_DATA 
 							DataValue=new DateTime(ts_data.year,ts_data.month,ts_data.day,ts_data.hour,
 								ts_data.minute,ts_data.second,Convert.ToInt32(ts_data.fraction));
@@ -529,7 +538,7 @@ namespace System.Data.Odbc
                                         case OdbcType.Image :
                                                 bufsize = col.MaxLength + 1;
                                                 buffer = new byte [bufsize];
-                                                long read = GetBytes (ColIndex, 0, buffer, 0, bufsize);
+                                                long read = GetBytes (ordinal, 0, buffer, 0, bufsize);
                                                 ret = OdbcReturn.Success;
                                                 DataValue = buffer;
                                                 break;