111 references to ConnectionState
Aspire.Hosting.MySql.Tests (3)
MySqlFunctionalTests.cs (3)
180Assert.Equal(ConnectionState.Open, connection.State); 250Assert.Equal(ConnectionState.Open, connection.State); 356Assert.Equal(ConnectionState.Open, connection.State);
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
406Assert.Equal(ConnectionState.Open, connection.State);
Aspire.Hosting.SqlServer.Tests (3)
SqlServerFunctionalTests.cs (3)
95if (conn.State != System.Data.ConnectionState.Open) 198if (conn.State != System.Data.ConnectionState.Open) 280if (conn.State != System.Data.ConnectionState.Open)
Microsoft.Data.Analysis (1)
Extensions.cs (1)
26if (connection.State == ConnectionState.Closed)
netstandard (1)
netstandard.cs (1)
482[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.ConnectionState))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
56[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.ConnectionState))]
System.Data.Common (39)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (10)
334private static string ConnectionStateMsg(ConnectionState state) 338case (ConnectionState.Closed): 339case (ConnectionState.Connecting | ConnectionState.Broken): // treated the same as closed 341case (ConnectionState.Connecting): 343case (ConnectionState.Open): 345case (ConnectionState.Open | ConnectionState.Executing): 347case (ConnectionState.Open | ConnectionState.Fetching):
System\Data\Common\AdapterUtil.Common.cs (1)
473internal static InvalidOperationException UpdateOpenConnectionRequired(StatementType statementType, bool isRowUpdatingCommand, ConnectionState state)
System\Data\Common\DBCommandBuilder.cs (1)
580if (0 == (ConnectionState.Open & connection.State))
System\Data\Common\DbConnection.cs (1)
47public abstract ConnectionState State { get; }
System\Data\Common\DbDataAdapter.cs (19)
414ConnectionState originalState = ConnectionState.Open; 620ConnectionState originalState = ConnectionState.Open; 973ConnectionState[] connectionStates = new ConnectionState[5]; // closed by default (== 0) 1202ConnectionState state = UpdateConnectionOpen(connection, StatementType.Batch, connections, connectionStates, useSelectConnectionState); 1205if (ConnectionState.Open == state) 1219ConnectionState state = UpdateConnectionOpen(connection, statementType, connections, connectionStates, useSelectConnectionState); 1220if (ConnectionState.Open == state) 1298ConnectionState state = UpdateConnectionOpen(connection, StatementType.Batch, connections, connectionStates, useSelectConnectionState); 1309if (ConnectionState.Open == state) 1460private static ConnectionState UpdateConnectionOpen(IDbConnection connection, StatementType statementType, IDbConnection?[] connections, ConnectionState[] connectionStates, bool useSelectConnectionState) 1471connectionStates[index] = ConnectionState.Closed; // required, open may throw 1806private static void QuietClose(IDbConnection? connection, ConnectionState originalState) 1811if ((null != connection) && (ConnectionState.Closed == originalState)) 1822private static void QuietOpen(IDbConnection connection, out ConnectionState originalState) 1826if (ConnectionState.Closed == originalState)
System\Data\IDbConnection.cs (1)
14ConnectionState State { get; }
System\Data\StateChangeEvent.cs (6)
8private readonly ConnectionState _originalState; 9private readonly ConnectionState _currentState; 11public StateChangeEventArgs(ConnectionState originalState, ConnectionState currentState) 17public ConnectionState CurrentState 25public ConnectionState OriginalState
System.Data.Odbc (61)
Common\System\Data\Common\AdapterUtil.Odbc.cs (3)
264internal static InvalidOperationException OpenConnectionRequired(string method, ConnectionState state) 324internal static Exception ConnectionAlreadyOpen(ConnectionState state) 328internal static Exception OpenConnectionPropertySet(string property, ConnectionState state)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
83if ((oldConnection != null) && (oldConnection.State == ConnectionState.Open))
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (10)
334private static string ConnectionStateMsg(ConnectionState state) 338case (ConnectionState.Closed): 339case (ConnectionState.Connecting | ConnectionState.Broken): // treated the same as closed 341case (ConnectionState.Connecting): 343case (ConnectionState.Open): 345case (ConnectionState.Open | ConnectionState.Executing): 347case (ConnectionState.Open | ConnectionState.Fetching):
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionClosed.cs (7)
13protected DbConnectionClosed(ConnectionState state, bool hidePassword, bool allowSetConnectionString) : base(state, hidePassword, allowSetConnectionString) 41protected DbConnectionBusy(ConnectionState state) : base(state, true, false) 54private DbConnectionClosedBusy() : base(ConnectionState.Closed) 64private DbConnectionOpenBusy() : base(ConnectionState.Open) 75private DbConnectionClosedConnecting() : base(ConnectionState.Connecting) 119private DbConnectionClosedNeverOpened() : base(ConnectionState.Closed, false, true) 130private DbConnectionClosedPreviouslyOpened() : base(ConnectionState.Closed, true, true)
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionInternal.cs (8)
15internal static readonly StateChangeEventArgs StateChangeClosed = new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed); 16internal static readonly StateChangeEventArgs StateChangeOpen = new StateChangeEventArgs(ConnectionState.Closed, ConnectionState.Open); 20private readonly ConnectionState _state; 37protected DbConnectionInternal() : this(ConnectionState.Open, true, false) 42internal DbConnectionInternal(ConnectionState state, bool hidePassword, bool allowSetConnectionString) 164public ConnectionState State
System\Data\Odbc\OdbcCommand.cs (12)
42private ConnectionState _cmdState; 71if (ConnectionState.Fetching == _cmdState) 490return (ConnectionState.Closed == _cmdState); 526_cmdState = ConnectionState.Closed; 823_cmdState = ConnectionState.Fetching; 827if (ConnectionState.Fetching != _cmdState) 835if (ConnectionState.Closed != _cmdState) 837_cmdState = ConnectionState.Closed; 884if (0 != (ConnectionState.Fetching & _connection!.InternalState)) 945ConnectionState state = connection.State; 947if (ConnectionState.Open != state) 960_cmdState = ConnectionState.Executing;
System\Data\Odbc\OdbcCommandBuilder.cs (2)
133ConnectionState state = connection.State; 135if (ConnectionState.Open != state)
System\Data\Odbc\OdbcConnection.cs (8)
138public override ConnectionState State 163internal ConnectionState InternalState 313ConnectionState state = InternalState; 314if (ConnectionState.Open != state) 634ConnectionState state = InternalState; 635if (ConnectionState.Open != state) 640if (ConnectionState.Open != state) 642if (0 != (ConnectionState.Fetching & state))
System\Data\Odbc\OdbcConnectionHelper.cs (10)
141if (ConnectionState.Open == innerConnection.State) 220ConnectionState originalState = _innerConnection.State & ConnectionState.Open; 221ConnectionState currentState = to.State & ConnectionState.Open; 222if ((originalState != currentState) && (ConnectionState.Closed == currentState)) 228if (ConnectionState.Closed == originalState && ConnectionState.Open == currentState) 232else if (ConnectionState.Open == originalState && ConnectionState.Closed == currentState)
System.Data.OleDb (1)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (1)
107public override System.Data.ConnectionState State { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } }