I want a SQL query that retrieves columns from different tables in Visual Basic 2010.
I have four tables like this:
tblTeacher
consists of•
TID
(pk)
•TName
tblSubject
consists of•
SID
(pk)
•subName
•TID
(fk)
•TMID
(fk)tblTime
consists of•
TMID
(pk)
•TMValue
tblLecture
consists of•
LecID
(pk)
•LecDate
•TID
(fk)
•subID
(fk)
•TMID
(fk)
tblLecture
is for registered Lectures. There is a one-to-many relationship between the tables, wheretblLecture
is many. Now my question is:
I want a SQL query that retrieves the registered Lectures and returns columns LecID
, LecDate
, TName
, subName
, TMValue
. I want to view the results in a DataGridView.
How can I call this SQL in my project please? (In my project, I use an Access database and SQL.)