2 // Mono.Data.TdsClient.TdsConnection.cs
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) 2002 Tim Coleman
10 using Mono.Data.TdsClient.Internal;
12 using System.Collections;
13 using System.ComponentModel;
16 namespace Mono.Data.TdsClient {
17 public class TdsConnection : Component, ICloneable, IDbConnection
21 internal TdsConnectionInternal connection;
27 public TdsConnection (TdsServerType serverType)
28 : this (serverType, 15, true, false, IsolationLevel.ReadCommitted)
32 public TdsConnection (TdsServerType serverType, int connectionTimeout)
33 : this (serverType, connectionTimeout, true, false, IsolationLevel.ReadCommitted)
37 public TdsConnection (TdsServerType serverType, int connectionTimeout, bool autoCommit)
38 : this (serverType, connectionTimeout, autoCommit, false, IsolationLevel.ReadCommitted)
42 public TdsConnection (TdsServerType serverType, int connectionTimeout, bool autoCommit, bool readOnly, IsolationLevel isolationLevel)
44 connection = new TdsConnectionInternal (serverType, connectionTimeout, autoCommit, readOnly, isolationLevel);
47 #endregion // Constructors
51 public string ConnectionString {
52 get { return connection.ConnectionString; }
53 set { connection.ConnectionString = value; }
56 public string Database {
57 get { return connection.Database; }
58 set { connection.Database = value; }
61 public ConnectionState State {
62 get { return connection.State; }
65 public int ConnectionTimeout {
66 get { return connection.ConnectionTimeout; }
67 set { connection.ConnectionTimeout = value; }
70 #endregion // Properties
74 public void ChangeDatabase (string databaseName)
76 connection.ChangeDatabase (databaseName);
84 IDbCommand IDbConnection.CreateCommand ()
86 return ((IDbConnection) connection).CreateCommand ();
89 object ICloneable.Clone()
91 throw new NotImplementedException ();
94 IDbTransaction IDbConnection.BeginTransaction ()
96 return ((IDbConnection) connection).BeginTransaction ();
99 IDbTransaction IDbConnection.BeginTransaction (IsolationLevel il)
101 return ((IDbConnection) connection).BeginTransaction (il);
109 #endregion // Methods