I have created a SQL statement that gathers unprocessed files from the database. It uses the DicomDataType_LK table to limit results to those I am interested in. When I run it, I get I get two results.
SELECT * FROM [Procedure].DicomData dicoms
JOIN [Procedure].DicomDataType_LK dtype
ON dicoms.DicomDataTypeID = dtype.DicomDataTypeID
WHERE dicoms.ProcedureID = '00000000-0000-0000-0000-000000000000'
AND dicoms.CreateDate > '3/27/2017'
AND (dtype.DicomDataType LIKE 'V Density'
OR dtype.DicomDataType LIKE 'Q Density'
OR dtype.DicomDataType LIKE 'i Density'
OR dtype.DicomDataType LIKE 'u Density')
I have translated this into LINQ to SQL, but with the same connection I am getting zero results.
IQueryable<DicomData> rows = from dicoms in db.DicomDatas
join dtype in db.DicomDataType_LKs
on dicoms.DicomDataTypeID equals dtype.DicomDataTypeID
where dicoms.ProcedureID == Guid.Empty
&& dicoms.CreateDate > fromTime
&& (dtype.DicomDataType.Equals("V Density")
|| dtype.DicomDataType.Equals("Q Density")
|| dtype.DicomDataType.Equals("i Density")
|| dtype.DicomDataType.Equals("u Density"))
select dicoms;
I have confirmed that fromTime gives a value that should include my two results. Could someone please let me know what I am doing wrong in my translation?