Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Linq Using Join SQL Syntax Question?
I am new to Linq, and I am having trouble grasping the syntax with respect to multi-table joins. I have three tables... workItem, workItemTemplate, and skill. A workItem has a particular kyworkItemTemplate which is used as a foreign key to the workItemTemplate table. A workItemTemplate has a kyWorkItemType which joins it to a skills table. Each row in the skills table indicates a workItemType that a user can perform.
The SQL that does what I want looks like this...
select s.*
from workitem w
inner join workitemtemplate t
on w.kyworkitemtemplate = t.kyworkitemtemplate
inner join skill s
on t.kyworkitemtype = s.kyworkitemtype
where s.kyUser = 'e158177'
and w.kyworkitem = 138
OR
select s.*
from workitem w, workitemtemplate t, skill s
where w.kyworkitemtemplate = t.kyworkitemtemplate
and t.kyworkitemtype = s.kyworkitemtype
and s.kyUser = 'e158177'
and w.kyworkitem = 138;
If either of these retorns a row, I know that employee e158177 has the skills to work the particular workItem #138. Can anyone help me out with the Linq syntax?
2 Answers
- GardnerLv 71 decade ago
I have only used LINQ with SQL 1 time so far. Your 2nd option looks valid to me, you might try to use the andalso instead of just and, see if you get better results with that. I know in VB that LINQ seems to like double quotes better than single quotes.
Sorry I can't be of more help.
Source(s): VB.NET Programmer