954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Query Problem- return value

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.

uva1102
Light Poster
40 posts since Aug 2011
Reputation Points: 10
Solved Threads: 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.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

A description of what the "query" is supposed to do would also be nice.

adam_k
Practically a Posting Shark
804 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
 

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.

thines01
Postaholic
Team Colleague
2,425 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: