projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/mono/mono into issue4328
[mono.git]
/
mcs
/
class
/
System.Data
/
System.Data.Common
/
DbConnection.cs
diff --git
a/mcs/class/System.Data/System.Data.Common/DbConnection.cs
b/mcs/class/System.Data/System.Data.Common/DbConnection.cs
index aaf2099255829990de316b469a4576e2ea56d745..ce68ec9cef748f23a0bb67af1eba0d11d38a11ca 100644
(file)
--- a/
mcs/class/System.Data/System.Data.Common/DbConnection.cs
+++ b/
mcs/class/System.Data/System.Data.Common/DbConnection.cs
@@
-30,14
+30,17
@@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
-
using System.ComponentModel;
using System.Data;
#if NET_2_0 && !TARGET_JVM
using System.Transactions;
#endif
using System.ComponentModel;
using System.Data;
#if NET_2_0 && !TARGET_JVM
using System.Transactions;
#endif
+#if NET_4_5
+using System.Threading;
+using System.Threading.Tasks;
+#endif
+
namespace System.Data.Common {
public abstract class DbConnection : Component, IDbConnection, IDisposable
{
namespace System.Data.Common {
public abstract class DbConnection : Component, IDbConnection, IDisposable
{
@@
-50,11
+53,7
@@
namespace System.Data.Common {
#endregion // Constructors
#region Properties
#endregion // Constructors
#region Properties
-#if NET_2_0
- [SettingsBindableAttribute (true)]
-#else
[RecommendedAsConfigurable (true)]
[RecommendedAsConfigurable (true)]
-#endif
[RefreshProperties (RefreshProperties.All)]
[DefaultValue ("")]
public abstract string ConnectionString { get; set; }
[RefreshProperties (RefreshProperties.All)]
[DefaultValue ("")]
public abstract string ConnectionString { get; set; }
@@
-245,7
+244,7
@@
namespace System.Data.Common {
}
}
}
}
- static class MetaDataCollections
+
internal
static class MetaDataCollections
{
static readonly ColumnInfo [] columns = {
new ColumnInfo ("CollectionName", typeof (string)),
{
static readonly ColumnInfo [] columns = {
new ColumnInfo ("CollectionName", typeof (string)),
@@
-713,12
+712,19
@@
namespace System.Data.Common {
for (int i = 0; i < length; i++) {
command.Parameters [i].Value = restrictionValues [i];
}
for (int i = 0; i < length; i++) {
command.Parameters [i].Value = restrictionValues [i];
}
- DbProviderFactory dbProvider = DbProviderFactories.GetFactory (this.GetType (). ToString ());
- DbDataAdapter dataAdapter = dbProvider.CreateDataAdapter ();
+ DbDataAdapter dataAdapter = DbProviderFactory.CreateDataAdapter ();
dataAdapter.SelectCommand = command;
dataAdapter.Fill (dataTable);
return dataTable;
}
dataAdapter.SelectCommand = command;
dataAdapter.Fill (dataTable);
return dataTable;
}
+
+ protected virtual DbProviderFactory DbProviderFactory {
+#if MOBILE
+ get {throw new NotImplementedException();}
+#else
+ get { return DbProviderFactories.GetFactory (this.GetType (). ToString ()); }
+#endif
+ }
#endif
IDbTransaction IDbConnection.BeginTransaction ()
#endif
IDbTransaction IDbConnection.BeginTransaction ()
@@
-738,11
+744,24
@@
namespace System.Data.Common {
public abstract void Open ();
public abstract void Open ();
- protected virtual void OnStateChange (StateChangeEventArgs stateChange
d
)
+ protected virtual void OnStateChange (StateChangeEventArgs stateChange)
{
if (StateChange != null)
{
if (StateChange != null)
- StateChange (this, stateChange
d
);
+ StateChange (this, stateChange);
}
}
+
+#if NET_4_5
+ public Task OpenAsync ()
+ {
+ return OpenAsync (CancellationToken.None);
+ }
+
+ [MonoTODO]
+ public virtual Task OpenAsync (CancellationToken cancellationToken)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
#endregion // Methods
#endregion // Methods
@@
-750,5
+769,3
@@
namespace System.Data.Common {
}
}
}
}
-
-#endif