internal static InvalidOperationException UpdateOpenConnectionRequired(StatementType statementType, bool isRowUpdatingCommand, ConnectionState state) { string resource; if (isRowUpdatingCommand) { resource = SR.ADP_OpenConnectionRequired_Clone; } else { switch (statementType) { case StatementType.Insert: resource = SR.ADP_OpenConnectionRequired_Insert; break; case StatementType.Update: resource = SR.ADP_OpenConnectionRequired_Update; break; case StatementType.Delete: resource = SR.ADP_OpenConnectionRequired_Delete; break; #if DEBUG case StatementType.Select: Debug.Assert(false, "shouldn't be here"); goto default; case StatementType.Batch: Debug.Assert(false, "isRowUpdatingCommand should have been true"); goto default; #endif default: throw ADP.InvalidStatementType(statementType); } } return(InvalidOperation(SR.Format(resource, ADP.ConnectionStateMsg(state)))); }
internal static Exception OpenConnectionPropertySet(string property, ConnectionState state) { return(InvalidOperation(SR.GetString(SR.ADP_OpenConnectionPropertySet, property, ADP.ConnectionStateMsg(state)))); }
internal static Exception ConnectionAlreadyOpen(ConnectionState state) { return(InvalidOperation(SR.GetString(SR.ADP_ConnectionAlreadyOpen, ADP.ConnectionStateMsg(state)))); }
internal static InvalidOperationException OpenConnectionRequired(string method, ConnectionState state) { return(InvalidOperation(SR.GetString(SR.ADP_OpenConnectionRequired, method, ADP.ConnectionStateMsg(state)))); }