troubleshooting Question

Populating a gridview from an SQL using an outerjoin and ISNULL

Avatar of Spike
Spike asked on
Web DevelopmentMicrosoft SQL Server 2008
3 Comments1 Solution257 ViewsLast Modified:
I'm using an outerjoin with ISNULL as follows to populate a gridview on a webpage:

SELECT id,thing1,ISNULL(valid, 0)  as Valid
FROM things as d  left OUTER JOIN thing2 r  ON d.ID=r.parentThingID  
WHERE d.ID =1
 
Which returns the correct results (thanks guys!)

but

when I try to populate the grridview, the checkboxes fail to "check" based on the value in valid:

i.e. Checked='<%# Convert.ToBoolean(Eval("Valid")) %>'/>

The check box gets populated fine if I'm just using a straight queary without using the ISNULL. (where none of the values are null).

Cheers
ASKER CERTIFIED SOLUTION
Pratima Pharande

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros