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