This doesn't work. I keep getting this error:
"ORA-01745: invalid host/bind variable name"
Code: Select all
Dim command As OracleCommand = OracleConnection.CreateCommand()
command.CommandText = "SELECT * FROM users WHERE uname = :user AND upass = :pass"
command.ParameterCheck = True
command.PassParametersByName = True
command.CommandType = CommandType.Text
command.Prepare()
command.Parameters.Add("user", "test")
command.Parameters.Add("pass", "test")
Using reader As OracleDataReader = command.ExecuteReader()
If reader.HasRows Then 'user exists
While reader.Read()
'do something here
End While
End If
End Using
Thanks,
Tegan