Boolean
-
8/8/2012 3:56:22 PM
Return no records for a datasource?
Hi
I have a datasource that is pointing to an ascx file. In the ascx file I have a list of related IDs that are used to pull data from the CMS Tree. Not all documents have these related ID's, they are set by the user.
Inside the datasource it builds out a where statement. If the related IDs exist, the where statement says "Where ID = 1 OR ID = 2" etc. etc. But if no IDs are supplied, the where statement is empty, which causes ALL records to be returned.
What I would like to do is say "if document does not contain list of IDs, return 0 records to the datasource", but I can't figure out a way of doing this short of writing "Where 1=2" =)
Is there a way to manually set the datasource to return no records? I tried StopProcessing but it doesn't seem to work.
Thanks
|