[Mono-bugs] [Bug 76467][Wis] New - Decimal parameter of SqlCommand causes exception when executing.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Oct 18 07:52:28 EDT 2005


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 flashfm at yandex.ru.

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

--- shadow/76467	2005-10-18 07:52:28.000000000 -0400
+++ shadow/76467.tmp.30916	2005-10-18 07:52:28.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 76467
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Windows XP SP2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Data.SqlClient
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: flashfm at yandex.ru               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Decimal parameter of SqlCommand causes exception when executing.
+
+Description of Problem:
+
+Mono 1.1.9.2. Windows XP SP2. Assembly was compiled by Visual Studio 2003.
+
+Add some decimal parameter to SqlCommand and try to call ExecuteNonQuery.
+You'll get an exception.
+
+Steps to reproduce the problem:
+1. Create valid SqlCommand instance.
+2. Set CommandText property to (for example) "Update [Order] set
+[TotalPrice]=@P1"
+Add new SqlParameter to the command with decimal value. For example:
+
+      SqlParameter p = new SqlParameter("@P1", new decimal(3.1416));
+      // next four lines has no affect
+      p.Scale = 4;
+      p.Precision = 8;
+      p.SqlDbType = SqlDbType.Decimal;
+      p.Size = 13;
+      cmd.Parameters.Add(p);
+
+3. Call ExecuteNonQuery() method of command.
+
+Actual Results:
+
+Unhandled Exception: System.Data.SqlClient.SqlException: Must pass
+parameter number 4 and subsequent parameters as '@name = value'. After the
+form '@name = value' has been used, all subsequent parameters must be
+passed in the form '@name = value'.
+
+Expected Results: Column values in the table are updated.
+
+How often does this happen?
+Always.
+
+Additional Information:
+With MS .NET Framework 1.1 adding decimal value works fine without
+specifying precision, scale, DbType and size.


More information about the mono-bugs mailing list