What's the equivalent of this Ms access in vb.net

SELECT COURSE_ID, COURSE_NAME FROM COURSES WHERE (COURSE_ID NOT IN (SELECT COURSE_ID FROM COURSES_TAKEN WHERE  UST_ID=1204));

I want to do it like:

Dim dass As New OleDbDataAdapter("SELECT COURSE_ID, COURSE_NAME FROM COURSES (WHERE COURSE_ID NOT IN (SELECT COURSE_ID FROM COURSES_TAKEN WHERE  UST_ID= " & User_ID));, cnss)

Or what's the proper syntax...?

Esam
_EsamAsked:
Who is Participating?
 
softplusCommented:
Dim dass As New OleDbDataAdapter("SELECT COURSE_ID, COURSE_NAME FROM COURSES (WHERE COURSE_ID NOT IN (SELECT COURSE_ID FROM COURSES_TAKEN WHERE  UST_ID= " & User_ID & "))", cnss)
Just remove the ; from the end of your query and place the closing ))'s as a string. Assuming cnss is your connection string.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.