예제 #1
0
        public virtual object Estado()
        {
            global::System.Data.OleDb.OleDbCommand command = ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[0]));
            global::System.Data.ConnectionState    previousConnectionState = command.Connection.State;
            if (((command.Connection.State & global::System.Data.ConnectionState.Open)
                 != global::System.Data.ConnectionState.Open))
            {
                command.Connection.Open();
            }
            object returnValue;

            try {
                returnValue = command.ExecuteScalar();
            }
            finally {
                if ((previousConnectionState == global::System.Data.ConnectionState.Closed))
                {
                    command.Connection.Close();
                }
            }
            if (((returnValue == null) ||
                 (returnValue.GetType() == typeof(global::System.DBNull))))
            {
                return(null);
            }
            else
            {
                return((object)(returnValue));
            }
        }
예제 #2
0
        public object LastID()
        {
            global::System.Data.OleDb.OleDbCommand command = adapter.SelectCommand;
            global::System.Data.ConnectionState    previousConnectionState = command.Connection.State;
            if (((command.Connection.State & global::System.Data.ConnectionState.Open)
                 != global::System.Data.ConnectionState.Open))
            {
                command.Connection.Open();
            }
            object returnValue;

            try {
                returnValue = command.ExecuteScalar();
            }
            finally {
                if ((previousConnectionState == global::System.Data.ConnectionState.Closed))
                {
                    command.Connection.Close();
                }
            }
            if (((returnValue == null) ||
                 (returnValue.GetType() == typeof(global::System.DBNull))))
            {
                return(null);
            }
            else
            {
                return((object)(returnValue));
            }
        }