Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 08, 2012 03:54 AM by Decker Dong - MSFT
Member
2 Points
17 Posts
Dec 07, 2012 02:28 PM|LINK
HI,
Can anyone advise on the LINQ equivalent of the following SQL
Select S.userSurname +', '+ S.userFirstName as ResourceName, ResActive, ResDesc from Resource R inner join Staff S on R.fkStaffStaffNo = S.userStaffNo
Contributor
5436 Points
1507 Posts
Dec 07, 2012 02:40 PM|LINK
CSharper2012 CSharper2012
http://msdn.microsoft.com/en-us/library/bb397941.aspx
var items = from db in Resource
join staff in Staff on db.fkStaffStaffNo equal staff.userStaffNo
select new
{
//Iterate the fields that you needd
}
All-Star
118619 Points
18779 Posts
Dec 08, 2012 03:54 AM|LINK
CSharper2012 Can anyone advise on the LINQ equivalent of the following SQL
Hello,
Not every SQL statement can be converted to LINQ successfully, if you really wanna use LINQ and translate SQL to LINQ, please download this tool to do a conversion:
http://sqltolinq.com/
CSharper2012
Member
2 Points
17 Posts
SQL to LINQ
Dec 07, 2012 02:28 PM|LINK
HI,
Can anyone advise on the LINQ equivalent of the following SQL
Select S.userSurname +', '+ S.userFirstName as ResourceName, ResActive, ResDesc from Resource R inner join Staff S on R.fkStaffStaffNo = S.userStaffNo
thaicarrot
Contributor
5436 Points
1507 Posts
Re: SQL to LINQ
Dec 07, 2012 02:40 PM|LINK
http://msdn.microsoft.com/en-us/library/bb397941.aspx
var items = from db in Resource
join staff in Staff on db.fkStaffStaffNo equal staff.userStaffNo
select new
{
//Iterate the fields that you needd
}
Weera
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: SQL to LINQ
Dec 08, 2012 03:54 AM|LINK
Hello,
Not every SQL statement can be converted to LINQ successfully, if you really wanna use LINQ and translate SQL to LINQ, please download this tool to do a conversion:
http://sqltolinq.com/