Link to home
Start Free TrialLog in
Avatar of Krummelz
KrummelzFlag for South Africa

asked on

EntityDataSource, Where clause, checking for null

I have an EntityDataSource on a web form. This datasource has a Where clause set to filter for certain records from my database. I've added another clause that checks for null values, but this does not work.

See my example code with the check for null added. It returns no records, but there are three such records that have the SourceType set to 'admin' and where the TargetID is null.
Where="(it.SourceType == 'Admin') && (it.TargetID == null)"

Open in new window

SOLUTION
Avatar of Avodah
Avodah
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Krummelz

ASKER

No that doesnt work, I get the following error:

" 'DBNull.value' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly., near multipart identifier, line 6, column 47. "
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
still get the same error..
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points. Really unexpected but much appreciated!