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