[Mono-bugs] [Bug 63541][Nor] New - OdbcDataReader: TIMESTAMP value retrieved as System.String instead of System.Byte[]

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 20 Aug 2004 11:45:49 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien.robitaille@croesus.com.

http://bugzilla.ximian.com/show_bug.cgi?id=63541

--- shadow/63541	2004-08-20 11:45:49.000000000 -0400
+++ shadow/63541.tmp.27948	2004-08-20 11:45:49.000000000 -0400
@@ -0,0 +1,88 @@
+Bug#: 63541
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastien.robitaille@croesus.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: OdbcDataReader: TIMESTAMP value retrieved as System.String instead of System.Byte[]
+
+Description of Problem:
+OdbcDataReader: TIMESTAMP value retrieved as System.String instead of 
+System.Byte[]
+
+Steps to reproduce the problem:
+1. Execute the following method:
+
+static void TestTimeStampDataType(string connectionString)
+{
+	using(IDbConnection dbConnection = new OdbcConnection
+(connectionString))
+	{
+		dbConnection.Open();
+		IDbCommand dbCommand = dbConnection.CreateCommand();
+
+		System.Console.WriteLine("CREATE TABLE");
+		dbCommand.CommandText = "CREATE TABLE MyTable (MyField 
+TIMESTAMP NOT NULL, MyCharField CHAR(1) NOT NULL)";
+		dbCommand.ExecuteNonQuery();
+
+		System.Console.WriteLine("INSERT INTO");
+		dbCommand.CommandText = "INSERT INTO MyTable 
+(MyCharField) VALUES ('X')";
+		dbCommand.ExecuteNonQuery();
+
+		System.Console.WriteLine("SELECT * FROM");
+		dbCommand.CommandText = "SELECT * FROM MyTable";
+
+		using(IDataReader reader = dbCommand.ExecuteReader())
+		{
+			while(reader.Read()) 
+			{
+				for(int index = 0; index < 
+reader.FieldCount; index++)
+				{
+					object dataValue = reader.GetValue
+(index);
+					System.Console.WriteLine
+(dataValue.GetType().ToString() + "\t" + dataValue.ToString());
+				}
+			}
+		}
+
+		System.Console.WriteLine("DROP TABLE");
+		dbCommand.CommandText = "DROP TABLE MyTable";
+		dbCommand.ExecuteNonQuery();
+	}
+}
+
+Actual Results:
+CREATE TABLE
+INSERT INTO
+SELECT * FROM
+System.String   0000000196a3f2ca
+System.String   X
+DROP TABLE
+
+
+Expected Results:
+CREATE TABLE
+INSERT INTO
+SELECT * FROM
+System.Byte[]   System.Byte[]
+System.String   X
+DROP TABLE
+
+How often does this happen? 
+
+
+Additional Information: