[Mono-bugs] [Bug 63122][Nor] New - SQLException invoking SqlCommandBuilder.DeriveParameters for a stored procedure
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 16 Aug 2004 04:29:48 -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 gert.driesen@pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=63122
--- shadow/63122 2004-08-16 04:29:48.000000000 -0400
+++ shadow/63122.tmp.11698 2004-08-16 04:29:48.000000000 -0400
@@ -0,0 +1,93 @@
+Bug#: 63122
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: Gentoo 2.6.7 R13 and Windows XP
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@novell.com
+ReportedBy: gert.driesen@pandora.be
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: SQLException invoking SqlCommandBuilder.DeriveParameters for a stored procedure
+
+When executing the following code on Mono 1.0 and CVS HEAD :
+
+using System.Data;
+using System.Data.SqlClient;
+
+public class EntryPoint
+{
+ public static void Main()
+ {
+ using (SqlConnection cn = new SqlConnection("...connectionstring..."))
+ using (SqlCommand cmd = new SqlCommand("...spname...", cn))
+ {
+ cn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlCommandBuilder.DeriveParameters(cmd);
+ }
+ }
+}
+
+The following exception is thrown :
+
+Unhandled Exception: System.Data.SqlClient.SqlException: @P1 is not a
+parameter
+for procedure sp_procedure_params_rowset.
+in <0x00103> System.Data.SqlClient.SqlConnection:ErrorHandler
+(object,Mono.Data.
+Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00066> (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_obje
+ct_TdsInternalErrorMessageEventArgs
+(object,Mono.Data.Tds.Protocol.TdsInternalEr
+rorMessageEventArgs)
+in <0x0002e> Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage
+(Mono.Data.Tds.Protoco
+l.TdsInternalErrorMessageEventArgs)
+in <0x00053> (wrapper remoting-invoke-with-check)
+Mono.Data.Tds.Protocol.Tds:OnT
+dsErrorMessage (Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00243> Mono.Data.Tds.Protocol.Tds:ProcessMessage
+(Mono.Data.Tds.Protocol.T
+dsPacketSubType)
+in <0x0004f> (wrapper remoting-invoke-with-check)
+Mono.Data.Tds.Protocol.Tds:Pro
+cessMessage (Mono.Data.Tds.Protocol.TdsPacketSubType)
+in <0x0014a> Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()
+in <0x00050> Mono.Data.Tds.Protocol.Tds:NextResult ()
+in <0x0007d> System.Data.SqlClient.SqlDataReader:NextResult ()
+in <0x0005a> (wrapper remoting-invoke-with-check)
+System.Data.SqlClient.SqlDataR
+eader:NextResult ()
+in <0x00107> System.Data.SqlClient.SqlDataReader:.ctor
+(System.Data.SqlClient.Sq
+lCommand)
+in <0x00053> (wrapper remoting-invoke-with-check)
+System.Data.SqlClient.SqlDataR
+eader:.ctor (System.Data.SqlClient.SqlCommand)
+in <0x0013c> System.Data.SqlClient.SqlCommand:DeriveParameters ()
+in <0x0004c> (wrapper remoting-invoke-with-check)
+System.Data.SqlClient.SqlComma
+nd:DeriveParameters ()
+in <0x0000e> System.Data.SqlClient.SqlCommandBuilder:DeriveParameters
+(System.Da
+ta.SqlClient.SqlCommand)
+in <0x00095> EntryPoint:Main ()
+
+To reproduce this issue :
+
+1. make sure you have SQL Server (or MSDE) installed
+2. execute the SQL Script that was attached to this bug report using, for
+example, SQL Server Query Analyser.
+ this will create a database called Reports, containing a single table
+ and one stored procedure
+3. modify the connectionstring in the attached C# source to match your
+local set-up
+4. compile and run the repro.