[Mono-bugs] [Bug 71766][Cri] New - RETURN_VALUE from stored procedure exception.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 25 Jan 2005 21:58:04 -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 andypalmer@adelphia.net.

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

--- shadow/71766	2005-01-25 21:58:04.000000000 -0500
+++ shadow/71766.tmp.11768	2005-01-25 21:58:04.000000000 -0500
@@ -0,0 +1,112 @@
+Bug#: 71766
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@novell.com                            
+ReportedBy: andypalmer@adelphia.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: RETURN_VALUE from stored procedure exception.
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+ Trying to get a return value from a SQL 7.0 stored procedure throws an exception ''int' is not a recognized CURSOR option.' 
+
+
+Steps to reproduce the problem:
+1. Create simple stored proc:
+
+CREATE PROCEDURE sp_ReturnValue @inVal int
+AS
+BEGIN
+	return(@inVal)
+END
+
+2. 
+Example code:
+System.Data.SqlClient.SqlConnection conn=null;
+try
+{
+ String connstr = PUT SOMETHING HERE;
+ conn=new System.Data.SqlClient.SqlConnection(connstr);
+ conn.Open();
+ System.Data.SqlClient.SqlCommand  cmd=
+      new System.Data.SqlClient.SqlCommand();
+ cmd.CommandText = "sp_ReturnValue";
+ cmd.CommandType =  System.Data.CommandType.StoredProcedure;
+ cmd.Connection = conn;
+ SqlParameter parm=
+    cmd.Parameters.Add("@inVal",System.Data.SqlDbType.Int);
+ parm.Value = 2;
+ parm = cmd.Parameters.Add("RETURN_VALUE",
+                           System.Data.SqlDbType.Int);
+ parm.Direction = System.Data.ParameterDirection.ReturnValue;			
+ System.Data.SqlClient.SqlDataReader rs = cmd.ExecuteReader();
+ System.Int32 x =                    
+    (System.Int32)cmd.Parameters["RETURN_VALUE"].Value;
+ Console.WriteLine(x);
+ rs.Close();
+ cmd.Parameters.Clear();
+ conn.Close();
+}
+catch(Exception e)
+{
+  Console.WriteLine(e.StackTrace);
+  Console.WriteLine(e.Message);
+}
+finally
+{
+  try {	conn.Close(); }	catch(Exception e){};
+}
+
+3. Throws exception every time.
+
+Actual Results:
+'int' is not a recognized CURSOR option.
+
+in <0x0011b> System.Data.SqlClient.SqlConnection:ErrorHandler 
+(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00069> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArgs 
+(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x0001e> Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage 
+(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00056> (wrapper remoting-invoke-with-check) 
+Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage 
+(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00276> Mono.Data.Tds.Protocol.Tds:ProcessMessage 
+(Mono.Data.Tds.Protocol.TdsPacketSubType)
+in <0x00052> (wrapper remoting-invoke-with-check) 
+Mono.Data.Tds.Protocol.Tds:ProcessMessage 
+(Mono.Data.Tds.Protocol.TdsPacketSubType)
+in <0x0015f> Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()
+in <0x00050> Mono.Data.Tds.Protocol.Tds:NextResult ()
+in <0x00089> System.Data.SqlClient.SqlDataReader:NextResult ()
+in <0x0005d> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlDataReader:NextResult ()
+in <0x00122> System.Data.SqlClient.SqlDataReader:.ctor 
+(System.Data.SqlClient.SqlCommand)
+in <0x00056> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlDataReader:.ctor (System.Data.SqlClient.SqlCommand)
+in <0x000a2> System.Data.SqlClient.SqlCommand:ExecuteReader 
+(System.Data.CommandBehavior)
+in <0x00054> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlCommand:ExecuteReader (System.Data.CommandBehavior)
+in <0x0017d> TestReturnValue.Program:Main (string[])
+
+Expected Results:
+
+returns the return value of the stored proc.
+
+How often does this happen? 
+Everytime.
+
+Additional Information: