[Mono-bugs] [Bug 76280][Nor] New - SybaseCommand.ExecuteNonQuery
always returns 0
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Sep 29 16:45:40 EDT 2005
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 sebastien.robitaille at croesus.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76280
--- shadow/76280 2005-09-29 16:45:40.000000000 -0400
+++ shadow/76280.tmp.20623 2005-09-29 16:45:40.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 76280
+Product: Mono: Class Libraries
+Version: 1.1
+OS: Red Hat 9.0
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: sebastien.robitaille at croesus.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: SybaseCommand.ExecuteNonQuery always returns 0
+
+Description of Problem:
+
+When inserting a row with SybaseCommand.ExecuteNonQuery, this method
+always returns 0 even when one row was affected.
+
+Steps to reproduce the problem:
+
+Execute the following code:
+
+IDbConnection dbConnection = new SybaseConnection(connectionString);
+dbConnection.Open();
+
+IDbCommand command = dbConnection.CreateCommand();
+command.CommandText = "CREATE TABLE XXX (X INTEGER, Y INTEGER)";
+int rowCount = command.ExecuteNonQuery();
+
+command.CommandText = "INSERT INTO XXX (X,Y) VALUES (1,2)";
+rowCount = command.ExecuteNonQuery();
+System.Console.WriteLine("RowCount returned by ExecuteNonQuery: " +
+rowCount);
+
+command.CommandText = "select count(*) FROM XXX";
+rowCount = (int)command.ExecuteScalar();
+System.Console.WriteLine("RowCount in database: " + rowCount);
+
+command.CommandText = "DROP TABLE XXX";
+rowCount = command.ExecuteNonQuery();
+
+dbConnection.Close();
+
+
+Actual Results:
+RowCount returned by ExecuteNonQuery: 0
+RowCount in database: 1
+
+Expected Results:
+RowCount returned by ExecuteNonQuery: 1
+RowCount in database: 1
+
+How often does this happen?
+Always with SybaseClient.
+SQLClient has the correct behavior.
More information about the mono-bugs
mailing list