Hi there
I have the following method;
But I have loads of rows with the id being passed in to this method, but it always returns false when it should return true.
Does anyone have any idea why?
Many thanks
I have the following method;
C#:
public static Boolean CheckIFPackageExists(string id)
{
OleDbConnection myConnection = GetConnection();
string myQuery = "SELECT * FROM Package WHERE Email =" + id;
OleDbCommand command = new OleDbCommand(myQuery, myConnection);
try
{
myConnection.Open();
OleDbDataReader myReader = command.ExecuteReader();
return myReader.Read();
}
catch (Exception ex)
{
Console.WriteLine("Exception in DBHandler", ex);
return false;
}
finally
{
myConnection.Close();
}
}
But I have loads of rows with the id being passed in to this method, but it always returns false when it should return true.
Does anyone have any idea why?
Many thanks