Hello,I have 2 tables (tblFiles and tblFilesToTask).tblFilesFileIdProjectIdFileNametblFilesToTaskFileIdTaskIdFileNameFiles from tblFiles can exist more than once in tblFilesToTask.I would like to have a list of files with ProjectId x where the TaskId is not the current TaskId. The files may exist in tblFilesToTask but may not have the TaskId.If I test my query it works, but if I use it in a ASP.Net page is doesn't. I guess there's something wrong with my query, but I cannot figure out what. SelectCommand="SELECT tblFiles.FileId, tblFiles.FileName, FilesPerTask.FileId AS FileToTask, FilesPerTask.TaskId, tblFiles.ProjectId FROM tblFiles LEFT OUTER JOIN FilesPerTask ON tblFiles.FileId = FilesPerTask.FileId WHERE (FilesPerTask.TaskId <> @TaskId) OR (FilesPerTask.TaskId IS NULL) AND (tblFiles.ProjectId = @ProjectId)"> <SelectParameters> <asp:SessionParameter Name="TaskId" SessionField="TaskId" /> <asp:SessionParameter Name="ProjectId" SessionField="ProjectId" Type="Int32" Direction="Input"/> </SelectParameters>