224 references to ConnectionState
System.Data (135)
fx\src\data\Microsoft\SqlServer\Server\sqlpipe.cs (1)
71
if (
ConnectionState
.Open != connection.State ) {
fx\src\data\System\Data\Common\AdapterUtil.cs (14)
857
static private string ConnectionStateMsg(
ConnectionState
state) { // MDAC 82165, if the ConnectionState enum to msg the localization looks weird
859
case (
ConnectionState
.Closed):
860
case (
ConnectionState
.Connecting|
ConnectionState
.Broken): // treated the same as closed
862
case (
ConnectionState
.Connecting):
864
case (
ConnectionState
.Open):
866
case (
ConnectionState
.Open|
ConnectionState
.Executing):
868
case (
ConnectionState
.Open|
ConnectionState
.Fetching):
1100
static internal InvalidOperationException OpenConnectionRequired(string method,
ConnectionState
state) {
1153
static internal InvalidOperationException UpdateOpenConnectionRequired(StatementType statementType, bool isRowUpdatingCommand,
ConnectionState
state) {
1400
static internal Exception ConnectionAlreadyOpen(
ConnectionState
state) {
1412
static internal Exception OpenConnectionPropertySet(string property,
ConnectionState
state) {
fx\src\data\System\Data\Common\DBCommandBuilder.cs (1)
520
if (0 == (
ConnectionState
.Open & connection.State)) {
fx\src\data\System\Data\Common\DBConnection.cs (1)
91
abstract public
ConnectionState
State {
fx\src\data\System\Data\Common\DbDataAdapter.cs (19)
349
ConnectionState
originalState =
ConnectionState
.Open;
519
ConnectionState
originalState =
ConnectionState
.Open;
815
ConnectionState
[] connectionStates = new
ConnectionState
[5]; // closed by default (== 0)
1014
ConnectionState
state = UpdateConnectionOpen(connection, StatementType.Batch, connections, connectionStates, useSelectConnectionState);
1017
if (
ConnectionState
.Open == state) {
1028
ConnectionState
state = UpdateConnectionOpen(connection, statementType, connections, connectionStates, useSelectConnectionState);
1029
if (
ConnectionState
.Open == state) {
1096
ConnectionState
state = UpdateConnectionOpen(connection, StatementType.Batch, connections, connectionStates, useSelectConnectionState);
1106
if (
ConnectionState
.Open == state) {
1237
private
ConnectionState
UpdateConnectionOpen(IDbConnection connection, StatementType statementType, IDbConnection[] connections,
ConnectionState
[] connectionStates, bool useSelectConnectionState) {
1247
connectionStates[index] =
ConnectionState
.Closed; // required, open may throw
1526
static private void QuietClose(IDbConnection connection,
ConnectionState
originalState) {
1530
if ((null != connection) && (
ConnectionState
.Closed == originalState)) {
1540
static private void QuietOpen(IDbConnection connection, out
ConnectionState
originalState) {
1543
if (
ConnectionState
.Closed == originalState) {
fx\src\data\System\Data\Common\DbProviderFactories.cs (7)
28
private static
ConnectionState
_initState; // closed, connecting, open
230
if (
ConnectionState
.Open != _initState) {
233
case
ConnectionState
.Closed:
234
_initState =
ConnectionState
.Connecting; // used for preventing recursion
240
_initState =
ConnectionState
.Open;
243
case
ConnectionState
.Connecting:
244
case
ConnectionState
.Open:
fx\src\data\System\Data\IDbConnection.cs (1)
27
ConnectionState
State {
fx\src\data\System\Data\Odbc\OdbcCommand.cs (12)
55
private
ConnectionState
cmdState;
79
if (
ConnectionState
.Fetching == cmdState) {
454
return (
ConnectionState
.Closed == cmdState);
485
this.cmdState =
ConnectionState
.Closed;
749
cmdState =
ConnectionState
.Fetching;
752
if(
ConnectionState
.Fetching != cmdState) {
760
if(
ConnectionState
.Closed != cmdState) {
761
cmdState =
ConnectionState
.Closed;
805
if (0 != (
ConnectionState
.Fetching & _connection.InternalState)) {
859
ConnectionState
state = connection.State;
861
if (
ConnectionState
.Open != state) {
871
cmdState =
ConnectionState
.Executing;
fx\src\data\System\Data\Odbc\OdbcCommandBuilder.cs (2)
131
ConnectionState
state = connection.State;
133
if (
ConnectionState
.Open != state) {
fx\src\data\System\Data\Odbc\OdbcConnection.cs (9)
35
private
ConnectionState
_extraState; // extras, like Executing and Fetching, that we add to the State.
146
override public
ConnectionState
State {
159
internal
ConnectionState
InternalState {
285
ConnectionState
state = InternalState;
286
if (
ConnectionState
.Open != state) {
555
ConnectionState
state = InternalState;
556
if (
ConnectionState
.Open != state) {
560
if (
ConnectionState
.Open != state) {
561
if (0 != (
ConnectionState
.Fetching & state)) {
fx\src\data\System\Data\OleDb\OLEDB_Util.cs (9)
311
internal const int InternalStateExecuting = (int) (
ConnectionState
.Open |
ConnectionState
.Executing);
312
internal const int InternalStateFetching = (int) (
ConnectionState
.Open |
ConnectionState
.Fetching);
313
internal const int InternalStateClosed = (int) (
ConnectionState
.Closed);
321
internal const int InternalStateExecutingNot = (int) ~(
ConnectionState
.Executing);
322
internal const int InternalStateFetchingNot = (int) ~(
ConnectionState
.Fetching);
323
internal const int InternalStateConnecting = (int) (
ConnectionState
.Connecting);
324
internal const int InternalStateOpen = (int) (
ConnectionState
.Open);
fx\src\data\System\Data\OleDb\OleDbCommandBuilder.cs (2)
122
ConnectionState
state = connection.State;
123
if (
ConnectionState
.Open != state) {
fx\src\data\System\Data\OleDb\OleDbConnection.cs (3)
215
override public
ConnectionState
State {
338
ConnectionState
state = State;
339
if (
ConnectionState
.Open != state) {
fx\src\data\System\Data\ProviderBase\DbConnectionClosed.cs (7)
24
protected DbConnectionClosed(
ConnectionState
state, bool hidePassword, bool allowSetConnectionString) : base(state, hidePassword, allowSetConnectionString) {
72
protected DbConnectionBusy(
ConnectionState
state) : base(state, true, false) {
84
private DbConnectionClosedBusy() : base(
ConnectionState
.Closed) {
92
private DbConnectionOpenBusy() : base(
ConnectionState
.Open) {
101
private DbConnectionClosedConnecting() : base(
ConnectionState
.Connecting) {
142
private DbConnectionClosedNeverOpened() : base(
ConnectionState
.Closed, false, true) {
151
private DbConnectionClosedPreviouslyOpened() : base(
ConnectionState
.Closed, true, true) {
fx\src\data\System\Data\ProviderBase\DbConnectionFactory.cs (1)
250
if ((oldConnection != null) && (oldConnection.State ==
ConnectionState
.Open)) {
fx\src\Data\System\Data\ProviderBase\DbConnectionHelper.cs (10)
156
if (
ConnectionState
.Open == innerConnection.State) {
329
ConnectionState
originalState = _innerConnection.State &
ConnectionState
.Open;
330
ConnectionState
currentState = to.State &
ConnectionState
.Open;
332
if ((originalState != currentState) && (
ConnectionState
.Closed == currentState)) {
339
if (
ConnectionState
.Closed == originalState &&
ConnectionState
.Open == currentState) {
342
else if (
ConnectionState
.Open == originalState &&
ConnectionState
.Closed == currentState) {
fx\src\data\System\Data\ProviderBase\DbConnectionInternal.cs (8)
32
internal static readonly StateChangeEventArgs StateChangeClosed = new StateChangeEventArgs(
ConnectionState
.Open,
ConnectionState
.Closed);
33
internal static readonly StateChangeEventArgs StateChangeOpen = new StateChangeEventArgs(
ConnectionState
.Closed,
ConnectionState
.Open);
37
private readonly
ConnectionState
_state;
64
protected DbConnectionInternal() : this(
ConnectionState
.Open, true, false) { // V1.1.3300
68
internal DbConnectionInternal(
ConnectionState
state, bool hidePassword, bool allowSetConnectionString) {
339
public
ConnectionState
State {
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (3)
1170
if(_ownConnection && _connection.State !=
ConnectionState
.Open) {
2084
if (
ConnectionState
.Open != _connection.State) {
2112
if (_connection.State !=
ConnectionState
.Open) {
fx\src\data\System\Data\SqlClient\SqlCommand.cs (8)
1383
if (_activeConnection.State !=
ConnectionState
.Open) {
1397
if ((_activeConnection.State !=
ConnectionState
.Open) || (!cachedAsyncState.IsActiveConnectionValid(_activeConnection))) {
4822
throw ADP.OpenConnectionRequired(method,
ConnectionState
.Closed);
4825
throw ADP.OpenConnectionRequired(method,
ConnectionState
.Broken);
4828
else if (_activeConnection.State ==
ConnectionState
.Closed) {
4829
throw ADP.OpenConnectionRequired(method,
ConnectionState
.Closed);
4831
else if (_activeConnection.State ==
ConnectionState
.Broken) {
4832
throw ADP.OpenConnectionRequired(method,
ConnectionState
.Broken);
fx\src\data\System\Data\SqlClient\SqlConnection.cs (9)
402
if (
ConnectionState
.Open == State) {
416
if (
ConnectionState
.Open == State) {
730
override public
ConnectionState
State {
734
return
ConnectionState
.Open;
1096
if (State !=
ConnectionState
.Open) {// if we cancelled before the connection was opened
1740
if (breakConnection && (
ConnectionState
.Open == State)) {
1780
Debug.Assert(
ConnectionState
.Open == State, "CompleteOpen not open");
2170
if (
ConnectionState
.Open == State) {
2192
if (
ConnectionState
.Open == State) {
fx\src\data\System\Data\SqlClient\SqlDependencyListener.cs (2)
872
if (
ConnectionState
.Closed != _con.State &&
ConnectionState
.Broken != _con.State) {
fx\src\data\System\Data\StateChangeEvent.cs (6)
13
private
ConnectionState
originalState;
14
private
ConnectionState
currentState;
16
public StateChangeEventArgs(
ConnectionState
originalState,
ConnectionState
currentState) {
21
public
ConnectionState
CurrentState {
27
public
ConnectionState
OriginalState {
System.Data.Entity (37)
System\Data\EntityClient\EntityAdapter.cs (1)
117
if (
ConnectionState
.Open != _connection.State)
System\Data\EntityClient\EntityCommand.cs (3)
782
if ((this._connection.State ==
ConnectionState
.Closed) || (this._connection.State ==
ConnectionState
.Broken))
785
this._connection.State ==
ConnectionState
.Closed ?
System\Data\EntityClient\EntityConnection.cs (24)
41
internal static readonly StateChangeEventArgs StateChangeClosed = new StateChangeEventArgs(
ConnectionState
.Open,
ConnectionState
.Closed);
42
internal static readonly StateChangeEventArgs StateChangeOpen = new StateChangeEventArgs(
ConnectionState
.Closed,
ConnectionState
.Open);
54
private
ConnectionState
_entityClientConnectionState =
ConnectionState
.Closed;
118
if (connection.State !=
ConnectionState
.Closed)
270
public override
ConnectionState
State
276
if (this._entityClientConnectionState ==
ConnectionState
.Open)
279
if (this.StoreConnection.State !=
ConnectionState
.Open)
281
return
ConnectionState
.Broken;
332
if (this.State !=
ConnectionState
.Open)
471
if ((null != _currentTransaction) && ((null == _currentTransaction.StoreTransaction.Connection) || (this.State ==
ConnectionState
.Closed)))
512
if (this.State !=
ConnectionState
.Closed)
518
OpenStoreConnectionIf(this._storeConnection.State !=
ConnectionState
.Open,
527
if (this._storeConnection == null || this._storeConnection.State !=
ConnectionState
.Open)
611
this._entityClientConnectionState =
ConnectionState
.Open;
702
if (this.State !=
ConnectionState
.Open)
744
if (this.State !=
ConnectionState
.Open)
1180
ConnectionState
previousState = this.State; // the public connection state before cleanup
1195
if (this._storeConnection != null && (this._storeConnection.State !=
ConnectionState
.Closed))
1221
private bool EntityCloseHelper(bool fireEventOnStateChange,
ConnectionState
previousState)
1225
this._entityClientConnectionState =
ConnectionState
.Closed;
1227
if (previousState ==
ConnectionState
.Open)
System\Data\Objects\ObjectContext.cs (6)
1407
if (
ConnectionState
.Closed == Connection.State)
1419
if ((_connection.State ==
ConnectionState
.Closed) || (_connection.State ==
ConnectionState
.Broken))
1422
_connection.State ==
ConnectionState
.Closed ? System.Data.Entity.Strings.EntityClient_ConnectionStateClosed : System.Data.Entity.Strings.EntityClient_ConnectionStateBroken);
1434
Debug.Assert(
ConnectionState
.Open == _connection.State, "Connection must be open.");
1548
if (e.CurrentState ==
ConnectionState
.Closed)
System\Data\SqlClient\SqlProviderServices.cs (2)
1062
bool openingConnection = sqlConnection.State ==
ConnectionState
.Closed;
1073
if (openingConnection && sqlConnection.State ==
ConnectionState
.Open)
System\Data\SqlClient\SqlVersion.cs (1)
53
System.Diagnostics.Debug.Assert(connection.State ==
ConnectionState
.Open, "Expected an open connection");
System.Data.Entity.Design (1)
System\Data\Entity\Design\SSDLGenerator\FunctionDetailsReader.cs (1)
33
Debug.Assert(connection.State ==
ConnectionState
.Open, "the connection is not Open");
System.Data.Linq (8)
DataContext.cs (2)
500
if (this.provider.Connection.State ==
ConnectionState
.Open) {
503
if (this.provider.Connection.State ==
ConnectionState
.Closed) {
SqlClient\SqlConnectionManager.cs (2)
42
if (this.connection.State ==
ConnectionState
.Closed) {
136
if (this.connection != null && this.connection.State !=
ConnectionState
.Closed) {
SqlClient\SqlProvider.cs (4)
541
if (this.conManager.Connection.State ==
ConnectionState
.Closed) {
710
System.Diagnostics.Debug.Assert(this.conManager.Connection.State ==
ConnectionState
.Closed);
730
if (conManager.Connection.State ==
ConnectionState
.Closed &&
768
if (conManager.Connection.State ==
ConnectionState
.Closed &&
System.Web (7)
State\sqlstateclientmanager.cs (3)
359
if (conn != null && (conn.Connection.State &
ConnectionState
.Open) == 0) {
879
if (cmd.Connection.State !=
ConnectionState
.Open) {
918
if (cmd.Connection.State !=
ConnectionState
.Open) {
UI\WebControls\SqlDataSourceView.cs (4)
719
if (command.Connection.State !=
ConnectionState
.Open) {
780
if (command.Connection.State ==
ConnectionState
.Open) {
1058
if (connection.State ==
ConnectionState
.Open) {
1095
if (connection.State !=
ConnectionState
.Open) {
System.Workflow.Runtime (36)
Hosting\DbResourceAllocator.cs (1)
181
Debug.Assert((connection.State == System.Data.
ConnectionState
.Open),
Hosting\LocalTransaction.cs (2)
104
if ((null != connection) && (
ConnectionState
.Closed != connection.State))
138
if ((null != connection) && (
ConnectionState
.Closed != connection.State))
Hosting\SqlWorkflowPersistenceService.cs (7)
118
if ((null == conn) || (
ConnectionState
.Open != conn.State))
254
if ((null == connection) || (
ConnectionState
.Open != connection.State))
303
if ((null == connection) || (
ConnectionState
.Open != connection.State))
368
if ((null == connection) || (
ConnectionState
.Open != connection.State))
418
if ((null == connection) || (
ConnectionState
.Open != connection.State))
488
if ((null == connection) || (
ConnectionState
.Open != connection.State))
548
if ((null != connection) && (
ConnectionState
.Closed != connection.State))
Tracking\SqlTrackingQuery.cs (2)
74
if (null != cmd && null != cmd.Connection &&
ConnectionState
.Closed != cmd.Connection.State)
115
if (null != cmd && null != cmd.Connection &&
ConnectionState
.Closed != cmd.Connection.State)
Tracking\SqlTrackingService.cs (24)
331
if ((null != cmd) && (null != cmd.Connection) && (
ConnectionState
.Closed != cmd.Connection.State))
441
if ((null != cmd) && (null != cmd.Connection) && (
ConnectionState
.Closed != cmd.Connection.State))
589
if ((null != command) && (null != command.Connection) && (
ConnectionState
.Closed != command.Connection.State))
601
if (
ConnectionState
.Open != command.Connection.State)
603
if (
ConnectionState
.Closed != command.Connection.State)
671
if ((null != cmd) && (null != cmd.Connection) && (
ConnectionState
.Closed != cmd.Connection.State))
836
if ((null != command) && (null != command.Connection) && (
ConnectionState
.Closed != command.Connection.State))
855
if ((null != command) && (null != command.Connection) && (
ConnectionState
.Closed != command.Connection.State))
1193
if ((null != conn) && (
ConnectionState
.Closed != conn.State))
1205
if ((null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1369
if ((null != conn) && (
ConnectionState
.Closed != conn.State))
1378
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1517
if ((null != conn) && (
ConnectionState
.Closed != conn.State))
1533
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1684
if ((null != conn) && (
ConnectionState
.Closed != conn.State))
1694
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1831
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1908
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
1971
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
2011
if (
ConnectionState
.Open != command.Connection.State)
2039
if ((null != command) && (null != command.Connection) && (
ConnectionState
.Closed != command.Connection.State))
2054
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
2093
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))
2118
if ((null == command) || (null == command.Connection) || (
ConnectionState
.Open != command.Connection.State))