[Mono-bugs] [Bug 70651][Nor] New - Error reading smalldatetime

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 18 Dec 2004 07:47:22 -0500 (EST)


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 rpaterlini@hotmail.com.

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

--- shadow/70651	2004-12-18 07:47:22.000000000 -0500
+++ shadow/70651.tmp.14881	2004-12-18 07:47:22.000000000 -0500
@@ -0,0 +1,68 @@
+Bug#: 70651
+Product: Mono: Class Libraries
+Version: 1.0
+OS: SUSE 9.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@novell.com                            
+ReportedBy: rpaterlini@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error reading smalldatetime
+
+Description of Problem: reading a field of type smalldatetime from
+SQLServer2000 return a wrong value.
+
+
+Steps to reproduce the problem:
+1. Build and run this code
+using System;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace MonoConsole
+{
+	class Class1
+	{
+
+		[STAThread]
+		static void Main(string[] args) {
+
+			string connectionString = "Server=192.168.1.1;Database=master;User
+ID=sa;Password=???;";
+			
+			SqlConnection db = new SqlConnection(connectionString);
+			db.Open();
+			SqlCommand dbcmd = db.CreateCommand();
+
+			dbcmd.CommandText = "select cast(getdate() as smalldatetime)";
+			SqlDataReader reader = dbcmd.ExecuteReader(CommandBehavior.SingleResult);
+			reader.Read();
+			Console.WriteLine( reader[0] );
+			reader.Close();
+			
+			dbcmd.Dispose();
+			db.Close(); 			
+		}
+	}
+}
+
+
+Actual Results: 7/14/1825 12:44:00 PM
+
+
+Expected Results: 12/18/2004 12:44:00 PM
+
+
+How often does this happen? Always whe using smalldatetime, never when
+using datetime
+
+
+Additional Information: Same behavior on Windows2003 with Mono 1.0.4 and on
+Suse9.1 with Mono 1.0.5.  Tested with SQLServer2000 sp3 on Win2003