[Mono-bugs] [Bug 53922][Nor] New - SqlParameters does not calculate varchar parameter length

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 5 Feb 2004 09:43:24 -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 jonwagner@hotmail.com.


--- shadow/53922	2004-02-05 09:43:24.000000000 -0500
+++ shadow/53922.tmp.24404	2004-02-05 09:43:24.000000000 -0500
@@ -0,0 +1,46 @@
+Bug#: 53922
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@ximian.com                            
+ReportedBy: jonwagner@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: SqlParameters does not calculate varchar parameter length
+Description of Problem:
+Adding a string SqlParameter doesn't calculate the parameter length, 
+resulting in a length of 1. This is not compatible with MS.NET code.
+Steps to reproduce the problem:
+1. Add a string parameter to a sql call, and execute it
+SqlCommand command = new SqlCommand ("sp_User_Add");
+command.CommandType = CommandType.StoredProcedure;
+command.Parameters.Add ("@UserID", UserID);
+Actual Results:
+SQL trace shows:
+sp_executesql N'SELECT * FROM [User] WHERE [User].[UserID] = @UserID;', 
+N'@UserID nvarchar(1)',  @UserID=N'f44da8ca-904b-4231-8a77-6bff46ac2c92'
+Expected Results:
+sp_executesql N'SELECT * FROM [User] WHERE [User].[UserID] = @UserID;', 
+N'@UserID nvarchar(39)',  @UserID=N'f44da8ca-904b-4231-8a77-6bff46ac2c92'
+How often does this happen? 
+Additional Information:
+mono 0.30