i originally wrote this code in visual basic and it worked fine but when i tried rewriting it in c# it raised an error saying 'dr is a variable but is being used like a method' , please how do i fix this?
Code:public bool validateuser(string password, string username)
{
OleDbCommand cmd = new OleDbCommand();
dbconnection db = new dbconnection();
cmd.Connection = db.connection;
cmd.CommandText = "select * from userlogin where password = ? and username = ?";
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("", password);
cmd.Parameters.AddWithValue("", username);
bool found = false;
OleDbDataReader dr = default(OleDbDataReader);
dr = cmd.ExecuteReader;
if (dr.Read) {
found = true;
}
return found;
}