ConnectionStateMsg() static private méthode

static private ConnectionStateMsg ( ConnectionState state ) : string
state ConnectionState
Résultat string
        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))));
        }
Exemple #2
0
 internal static Exception OpenConnectionPropertySet(string property, ConnectionState state)
 {
     return(InvalidOperation(SR.GetString(SR.ADP_OpenConnectionPropertySet, property, ADP.ConnectionStateMsg(state))));
 }
Exemple #3
0
 internal static Exception ConnectionAlreadyOpen(ConnectionState state)
 {
     return(InvalidOperation(SR.GetString(SR.ADP_ConnectionAlreadyOpen, ADP.ConnectionStateMsg(state))));
 }
Exemple #4
0
 internal static InvalidOperationException OpenConnectionRequired(string method, ConnectionState state)
 {
     return(InvalidOperation(SR.GetString(SR.ADP_OpenConnectionRequired, method, ADP.ConnectionStateMsg(state))));
 }