0

Hi everyone,

ALTER TABLE preventiveRecord
ADD Verifiedbymanager BIT NOT NULL
CONSTRAINT preventive_verify DEFAULT 0 WITH VALUES

ALTER TABLE preventiveRecord
ADD Verifiedbysupervisor BIT NOT NULL
CONSTRAINT preventive_verify DEFAULT 0 WITH VALUES

SELECT [ID]
,[Date_Done]
,[Date_Due]
,[SME]
,[Status]
,[History_ID]
,[Remark]
,[Verifiedbysupervisor]
,[Verifiedbymanager]
FROM [demo].[dbo].[preventiveRecord]

Here is my query :
from d in p.preventiveRecords.Where(d => d.Date_Done != null && p.preventiveRecords.Where( e =>e.VerifiedbySupervisor == null))

Please help me to how to return the value.

4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by thines01
0

The lines after "Here is my query" don't make a well-formed SQL statement. It will help if you don't mix-and-match your languages.

Please post the surrounding code so we can have a context, then maybe we can help.

Edited by BitBlt: n/a

0

Assuming this is LINQ:
It would probably be something like:

var lstOfRecords =
(
   from d in p.preventiveRecords.Where(d => d.Date_Done != null &&
   p.preventiveRecords.Where( e =>e.VerifiedbySupervisor == null))
   select new 
   {
      d.ID,
      d.Date_Done,
      d.Date_Due,
      d.SME,
      d.Status,
      d.History_ID,
      d.Remark,
      d.Verifiedbysupervisor,
      d.Verifiedbymanager
   } 
).ToList();

...but if you're trying to actually return this from a method, you will need to create a custom class to hold the values and return an instance of that class.

Edited by thines01: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.