TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Natalija
NA
21
2.1k
convert SQL to LINQ
Jun 16 2015 4:27 AM
Hi, All.
I have SQL-request:
select FullName, CreatedBy, CreatedOn, DomainName, ModifiedBy from SystemUser
where SystemUserId In (
SELECT SystemUserId
FROM [UserSettings]
where [TimeZoneBias] != -60
and [TimeZoneCode] != 110)
and IsDisabled = 0
I need to convert this request into LINQ.
I wrote this
(this is my first LINQ-request)
:
from s in SystemUserSet
where s.SystemUserId.Contains
(from sy in UserSettingsSet
where sy.TimeZoneBias != -60 && sy.TimeZoneCode != 110
select sy.SystemUserId)
&& s.IsDisabled = 0
select s
And I get error:
'System.Guid?' does not contain a definition for 'Contains' and the best extension method overload 'System.Linq.Queryable.Contains<TSource>(System.Linq.IQueryable<TSource>, TSource)' has some invalid arguments
Instance argument: cannot convert from 'System.Guid?' to 'System.Linq.IQueryable<System.Linq.IQueryable<System.Guid?>>'
Please, could you help with convert?
Thanks!
Reply
Answers (
22
)
how to replace white spaces in text file to upload in grid
deletetable