or
What I need to understand is how to get a result back from an execution statement such as:
thisCommand.CommandText = "SELECT myValue FROM DatabaseTable"
thisCommand.ExecuteNonQuery()
Is this possible? Is there a better way? If so, what do I need to do to make it happen?
When I run the following code, the value returned to my variable aResult is always -1, regardless of whether the search succeeds or not:
SQL_Command =
"SELECT * FROM LookupItemsTexts WHERE [Text] = 'fred'"
Log.WriteLine(SQL_Command)
'debug line
'Now execute the command
thisConnection.Close()
thisConnection.Open()
thisCommand.CommandText = SQL_Command
aResult = thisCommand.ExecuteNonQuery()
Log.WriteLine(aResult.ToString())
'debug line
Thanks,
Nigel Edwards.