views:

229

answers:

2
+1  Q: 

isNull(col, '')

How to write queries to do the followings in SubSonic/C#?

select isNull(col, someDefaultValue) from table

select x = case when (condition) then col1 else col2 end from table

+1  A: 

I don't have SubSonic up and running locally, but it looks like it supports the coalesce function, which is what your first query seems to be doing. (Coalesce takes any number of parameters and returns the first non-null one.)

Matt Poush
+1  A: 

You are probably going to want to use the Inline Query function example at subsonicproject

runxc1 Bret Ferrier
Thanks for the docs link -- didn't know that was there
ranomore