c# - Null Table adapter value with if then statement -


i have vb.net program checks see if specific terminal has been used on last week. i'd use if statement send me results. if tableadapter empty (null) execute in program... right have:

me.1tableadapter.fill(me.swipercheck.1, dtstartdate, todayend)  if (me.swipercheck.1.count = 0)  msgbox ("it worked") 

here dataset query:

select        case when count(sterminal) = 0 null else count(sterminal) end terminal            swipe        (dtcreated between @startdate , @enddate) , (sterminal = 'swiper 1') 

however it's not working , know output "null" if output not null, program works correctly.

if want return no records when count 0 have this:

select        count(sterminal) terminal            swipe        (dtcreated between @startdate , @enddate) , (sterminal = 'swiper 1') having count(sterminal) > 0 

that should make orignial if work correctly.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -