IF statement problems c#
I new to C# and i have been having problems which an if statement. I have a ASP.NET page which uses an IF statement to check against database results. Here is the code:
<Script Language="C#" Runat=Server>
OleDbConnection objConn = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\Inetpub\\database.mdb");
OleDbCommand objCmd = new OleDbCommand("Select Available FROM Paused WHERE ID=1;", objConn);
OleDbDataReader objRdr = objCmd.ExecuteReader();
Response.Write("iResult = 1");
Response.Write("iResult = 0");
Each time the code runs it output's 'iResult = 0' even though the database field is 'True'.
Any suggestions appreciated.
I believe Access actually uses -1 for Yes and 0 for No if you're using the Yes/No data type.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)