[Mono-bugs] [Bug 62131][Maj] New - Tds70.cs Prepare() call always throwing TdsInternalException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 30 Jul 2004 06:08:50 -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 fabrice.roge@laposte.net.

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

--- shadow/62131	2004-07-30 06:08:50.000000000 -0400
+++ shadow/62131.tmp.19324	2004-07-30 06:08:50.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 62131
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 8.0
+OS Details: upgraded distro for compiling and using Mono
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Data.SqlClient
+AssignedTo: rodrigo@novell.com                            
+ReportedBy: fabrice.roge@laposte.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Tds70.cs Prepare() call always throwing TdsInternalException
+
+Description of Problem:
+I am trying to connect to an sql database using Tds protocol. The database
+is MS Sqlserver on distant machine.
+I noticed that querying the database using standard execQuery works well,
+but every time I want to use prepared statements it crashes on
+cmd.Prepare() call (adding or not Parameters).
+
+A TdsInternalException is throw from
+Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70 class . So I retrieved Tds70.cs
+(mcs-1.0, cvs file version 1.26), and added debugging traces to it. Then I
+noticed that the problem was coming from lines #460 and #461 :
+
+if (!NextResult () || !NextRow () || ColumnValues [0] == null ||
+ColumnValues [0] == DBNull.Value)
+                                throw new TdsInternalException ();
+
+In fact NextRow always returns false, in any case. 
+So I modified the source removing !NextRow() test case in Tds70.cs and now
+it works well, I got my result filling my aspx. It's only a temporary
+solution as I don't know Tds protocol.
+
+
+Steps to reproduce the problem:
+1. Create a command with parameters
+3. query your database through Tds70 protocol (querying MS sql server)
+using Prepare() call on your command
+3. you get the exception
+
+Actual Results:
+Prepare() call on command throwing TdsInternalException 
+
+Expected Results:
+Prepare() call on command returning well with no exception on querying the
+database and getting the result.
+
+How often does this happen? 
+on every Prepare() call, on a command through Tds protocol toward an MS
+Sqlserver database.