ASP.NET SQL statement driving me mental

Associate
Joined
18 Oct 2002
Posts
972
Location
Derby
I am making a web application that records attendance for a Univeristy/School class. At present I have a version that runs with an Oracle database. For testing purposes I want to move it over to Microsoft Access. So far its been fairly simple, just changing connection strings etc.. however I am having trouble with my SQL statements.

Basically when a teacher logs in it stores their details in a session and it then uses the following sql statement to find all tutorials relevant to that teacher.

Code:
objCmd = New OleDbCommand("SELECT * FROM TUTORIAL WHERE LECTURERID='" + Session("sessionLecturerID") + "'", objConn)

For some reason when using this statement with access i get

Code:
System.Data.OleDb.OleDbException: Data type mismatch in criteria expression

I have tried simple statements and the data comes out alright as well as the session variables. I have tried looking around to see if I have some bad syntax but to no avail. Any help really appreciated.
 
Back
Top Bottom