[Mono-bugs] [Bug 60033][Blo] New - SqlDataAdapter.Fill throws SqlException "Invalid object name 'sp_reset_conection'"

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 11 Jun 2004 11:46:12 -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 cmyers@austin.rr.com.

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

--- shadow/60033	2004-06-11 11:46:11.000000000 -0400
+++ shadow/60033.tmp.7988	2004-06-11 11:46:11.000000000 -0400
@@ -0,0 +1,198 @@
+Bug#: 60033
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Windows XP
+OS Details: Windows XP SP1
+Status: NEW   
+Resolution: 
+Severity: 040 One week
+Priority: Blocker
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@novell.com                            
+ReportedBy: cmyers@austin.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SqlDataAdapter.Fill throws SqlException "Invalid object name 'sp_reset_conection'"
+
+Description of Problem:
+SqlDataAdapter.Fill throws SqlException with text 'Invalid object 
+name 'sp_reset_connection'
+
+Windows XP SP2
+Microsoft Windows NT 5.1.2600.0
+
+Mono 1.0 Beta 2
+1.1.4322.573
+
+SQL Server 2000 SP3
+Microsoft SQL Server  2000 - 8.00.760 (Intel X86)   Dec 17 2002 14:22:05  
+Developer Edition on Windows NT 5.2 (Build 3790: ) 
+
+
+Steps to reproduce the problem:
+1. Create a SqlDataAdapter
+2. Set the SqlCommand
+3. Call Fill()
+
+Actual Results:
+SqlException
+
+Expected Results:
+The dataset populated with results of the SelectCommand
+
+How often does this happen? 
+Every time
+
+Additional Information:
+I can provide any other information, I'm not sure what else you need 
+though.
+
+I've written a simple test outside of my code and it seems to work without 
+a SqlException, except the dataset is empty.
+
+Here's the sample code for the simple test:
+	DataSet ds = new DataSet();
+
+	SqlConnection con = new SqlConnection("Data 
+Source=buildmssql2k;Initial Catalog=cl12;User Id=sa;Password=sa;");
+	
+	SqlDataAdapter adapter = new SqlDataAdapter();
+	
+	SqlCommand cmd = (SqlCommand)con.CreateCommand();
+	con.Open();
+	cmd.Connection = con;
+	cmd.CommandText = "select * from table_case";
+	cmd.CommandType = CommandType.Text;
+					
+	adapter.SelectCommand = cmd;
+									
+	adapter.Fill(ds, "FillDataSet");
+	
+	Console.WriteLine(ds.GetXml());
+	
+All I get for this when I run through Mono is:
+<NewDataSet />
+
+When I run through MS.NET, it works fine and I get a bunch of XML back 
+with all the rows in table_case.
+
+Here's the main code I'm using in the real app with some cruft removed:
+
+	using( DbDataAdapter adapter = 
+DataAccessorFactory.Provider.GetAdapter( conn, cmdText ) )
+	{
+		IDbCommand cmd = conn.CreateCommand();
+		
+		// Set up the command, added parameters, etc
+		PrepareCommand( DataAccessorFactory.Provider, cmd, conn, 
+cmdType, cmdText, dataParams, out mustCloseConnection);
+		
+		((IDbDataAdapter)adapter).SelectCommand = cmd;
+
+		// Set up the table mappings if there are multiple result 
+sets
+		for( int i = 0; i < tableNames.Length; i++ )
+		{
+			if( i == 0 )
+			{
+				adapter.TableMappings.Add("FillDataSet", 
+tableNames[i]);
+			}
+			else
+			{
+				adapter.TableMappings.Add( "FillDataSet" + 
+i.ToString(), tableNames[i] );
+			}
+		}
+	
+		adapter.Fill( ds, "FillDataSet" );
+	}
+
+Here is the stack trace (the line numbers seem to be off (plus) by about 2 
+or 3 lines for some reason) :
+
+in [0x00034] 
+(at /cvs/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs:181) 
+System.Data.SqlClient.SqlConnection:ErrorHandler 
+(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00067> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArg
+s (object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x0004e> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArg
+s (object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x0004e> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArg
+s (object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in [0x00019] 
+(at /cvs/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1049) 
+Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage 
+(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x00058> (wrapper remoting-invoke-with-check) 
+Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage 
+(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in [0x000fe] 
+(at /cvs/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1090) 
+Mono.Data.Tds.Protocol.Tds:ProcessMessage 
+(Mono.Data.Tds.Protocol.TdsPacketSubType)
+in <0x00058> (wrapper remoting-invoke-with-check) 
+Mono.Data.Tds.Protocol.Tds:ProcessMessage 
+(Mono.Data.Tds.Protocol.TdsPacketSubType)
+in [0x00130] 
+(at /cvs/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1137) 
+Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()
+in [0x00017] 
+(at /cvs/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:257) 
+Mono.Data.Tds.Protocol.Tds:NextResult ()
+in [0x0003c] 
+(at /cvs/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs:809) 
+System.Data.SqlClient.SqlDataReader:NextResult ()
+in <0x0005a> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlDataReader:NextResult ()
+in [0x00076] 
+(at /cvs/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs:59) 
+System.Data.SqlClient.SqlDataReader:.ctor 
+(System.Data.SqlClient.SqlCommand)
+in <0x00058> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlDataReader:.ctor 
+(System.Data.SqlClient.SqlCommand)
+in [0x0002c] 
+(at /cvs/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs:316) 
+System.Data.SqlClient.SqlCommand:ExecuteReader 
+(System.Data.CommandBehavior)
+in <0x0005a> (wrapper remoting-invoke-with-check) 
+System.Data.SqlClient.SqlCommand:ExecuteReader 
+(System.Data.CommandBehavior)
+in [0x00002] 
+(at /cvs/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs:389) 
+System.Data.SqlClient.SqlCommand:System.Data.IDbCommand.ExecuteReader 
+(System.Data.CommandBehavior)
+in [0x0003e] 
+(at /cvs/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs:299) 
+System.Data.Common.DbDataAdapter:Fill 
+(System.Data.DataSet,int,int,string,System.Data.IDbCommand,System.Data.Comm
+andBehavior)
+in [0x0000c] 
+(at /cvs/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs:181) 
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
+in <0x0006c> (wrapper remoting-invoke-with-check) 
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
+in [0x0013c] (at 
+C:\first\project\FCFL.NET\trunk\Common\src\FChoice.Common\Data\SqlHelper.cs
+:878) FChoice.Common.Data.SqlHelper:FillDataSet (System.Data.DataSet,string
+[],System.Data.IDbConnection,System.Data.CommandType,string,FChoice.Common.
+Data.DataParameterCollection)
+in [0x00107] (at 
+C:\first\project\FCFL.NET\trunk\Common\src\FChoice.Common\Data\SqlHelper.cs
+:736) FChoice.Common.Data.SqlHelper:FillDataSet (System.Data.DataSet,string
+[])
+in [0x0011a] (at 
+C:\first\project\FCFL.NET\trunk\Common\src\FChoice.Common.Test\E_SqlHelperT
+est.cs:217) FChoice.Common.Test.E_SqlHelperTest:StoredProcHelper 
+(FChoice.Common.Data.SqlHelper,bool,string,string)
+in [0x00033] (at 
+C:\first\project\FCFL.NET\trunk\Common\src\FChoice.Common.Test\E_SqlHelperT
+est.cs:152) 
+FChoice.Common.Test.E_SqlHelperTest:ExecuteStoredProcs_Instance ()