I am using the following SQL query and the ExecuteScalar()
method to fetch data from an Oracle database:
sql = \"select username from usermst wh
I had this issue when the user connecting to the database had CONNECT permissions, but no permissions to read from the database. In my case, I could not even do something like this:
object userNameObj = command.ExecuteScalar()
Putting this in a try/catch (which you should probably be doing anyway) was the only way I could see to handle the insufficient permission issue.