I am using the following SQL query and the ExecuteScalar()
method to fetch data from an Oracle database:
sql = \"select username from usermst wh
Slight conjecture: if you check the stack for the exception, it is being thrown then the ADO.NET provider for Oracle is reading the underlying rowset to get the first value.
If there is no row, then there is no value to find.
To handle this case execute for a reader and handle Next()
returning false for the case of no match.