Why am I getting this error? "OledbException was unhandled" "Data type mismatch in criteria expression."
There is no problem when I am querying a string data type, but when I am querying a integer data type, I am always getting this problem..
I am using microsoft access 2007
here is my source code:
Public Function searchMemberId(ByVal userId As String) As DataSet
sqlStr = "Select Member_ID From tblMemberInfo Where Member_ID = '" & _
Val(userId) & "'"
ds.Clear()
da = New OleDbDataAdapter(sqlStr, con.ConnectionString)
da.Fill(ds, "john")
Return ds
End Function
the data type of Member_ID is autonumber, the error was always pointing to da.Fill(ds, "john")
"ds" is a Dataset