#At file:///C:/work/connector-net/trunk/ based on revid:reggie.burnett@stripped
931 Reggie Burnett 2010-09-17 [merge]
merged
modified:
CHANGES
MySql.Data/Provider/Source/MySqlHelper.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2010-09-17 16:07:04 +0000
+++ b/CHANGES 2010-09-17 16:25:02 +0000
@@ -1,4 +1,5 @@
- Fix installer bug related to .NET FW 4.0 (bug #56580)
+- Added MySqlHelper.ExecuteReader that takes an external connection and array of paramters (bug #56755)
Version 6.3.4
- Fix authorization popup after modifying stored procedure in VS (Bug #44715)
=== modified file 'MySql.Data/Provider/Source/MySqlHelper.cs'
--- a/MySql.Data/Provider/Source/MySqlHelper.cs 2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/MySqlHelper.cs 2010-09-17 16:24:05 +0000
@@ -298,21 +298,29 @@
public static MySqlDataReader ExecuteReader(string connectionString, string commandText, params MySqlParameter[] commandParameters)
{
//create & open a SqlConnection
- MySqlConnection cn = new MySqlConnection(connectionString);
- cn.Open();
+ using (MySqlConnection cn = new MySqlConnection(connectionString))
+ {
+ cn.Open();
- try
- {
//call the private overload that takes an internally owned connection in place of the connection string
- return ExecuteReader(cn, null, commandText, commandParameters, false );
- }
- catch
- {
- //if we fail to return the SqlDatReader, we need to close the connection ourselves
- cn.Close();
- throw;
+ return ExecuteReader(cn, null, commandText, commandParameters, false);
}
}
+
+ /// <summary>
+ /// Executes a single command against a MySQL database.
+ /// </summary>
+ /// <param name="connection">Connection to use for the command</param>
+ /// <param name="commandText">Command text to use</param>
+ /// <param name="commandParameters">Array of <see cref="MySqlParameter"/> objects to use with the command</param>
+ /// <returns><see cref="MySqlDataReader"/> object ready to read the results of the command</returns>
+ public static MySqlDataReader ExecuteReader(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
+ {
+ //call the private overload that takes an internally owned connection in place of the connection string
+ return ExecuteReader(connection, null, commandText, commandParameters, true);
+ }
+
+
#endregion
#region ExecuteScalar
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100917162502-poi17c234b12klqn.bundle
| Thread |
|---|
| • bzr commit into connector-net-trunk branch (reggie.burnett:931) | Reggie Burnett | 17 Sep |