Simple Oracle Database Query

Simple but needed.

public bool Login() {
            OracleConnection connection = new OracleConnection(SharedProvider.AppParams.ConnectionString);
            OracleCommand command = connection.CreateCommand();
            command.CommandText = "SELECT * FROM USERS WHERE NO=:NO AND PASS=:PASS";
            command.Parameters.AddWithValue(":NO", no);
            command.Parameters.AddWithValue(":PASS", password);
            command.Connection.Open();
            OracleDataReader reader = command.ExecuteReader();
            bool result = reader.Read();
            command.Connection.Close();
            return result;
        }
Advertisements