[Mono-bugs] [Bug 72607][Wis] Changed - mono don't close connection on Fill call (DATASET)
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 15 Feb 2005 09:05:06 -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 informatique.internet@fiducial.fr.
http://bugzilla.ximian.com/show_bug.cgi?id=72607
--- shadow/72607 2005-02-15 09:04:20.000000000 -0500
+++ shadow/72607.tmp.25739 2005-02-15 09:05:06.000000000 -0500
@@ -60,6 +60,32 @@
------- Additional Comments From informatique.internet@fiducial.fr 2005-02-15 09:04 -------
The problem is only when you don't open the connection before doing
the fill. in MS.NET "fill" will open the connection and will close it
after...
+
+------- Additional Comments From informatique.internet@fiducial.fr 2005-02-15 09:05 -------
+i've done a patch to correct that... :
+
+Index: class/System.Data/System.Data.Common/DbDataAdapter.cs
+===================================================================
+--- class/System.Data/System.Data.Common/DbDataAdapter.cs
+(revision 40676)
++++ class/System.Data/System.Data.Common/DbDataAdapter.cs
+(working copy)
+@@ -328,7 +328,11 @@
+ command.Connection.Open ();
+ commandBehavior |=
+CommandBehavior.CloseConnection;
+ }
+- return Fill (dataSet, srcTable,
+command.ExecuteReader (commandBehavior), startRecord, maxRecords);
++ int myresult= Fill(dataSet, srcTable,
+command.ExecuteReader (commandBehavior), startRecord, maxRecords);
++ if ((commandBehavior &
+CommandBehavior.CloseConnection) != 0)
++ command.Connection.Close ();
++
++ return myresult;
+ }
+