当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: char *menu_name[]={"aa","bb","cc", "cc","ee","ff","gg","hh", "ii",""}; 比如将上面的"aa",......
 ·如何清除application对象    »显示摘要«
    摘要: 急 ......


为什么判断不出数据库字段中的null

我在数据库(sqlServer2000)中的m表建两个字段a,b(varchar型,允许为空),把开表在a字段里随便写入几个字如ttt,保存。这时可以看到b字段里的为<NULL>标志。可是为什么判断不出<NULL>这个标志来?  
   
  程序如下:  
  为什么显示不出hello这个字符串?  
  <%  
  Set   rs   =   cn.Execute("select   a,b   from   m   where   a=ttt")  
  if   rs("b")   =   null   or   rs("b")   =   empty   or   rs("b")   =   ""   then  
  Response.Write   "hello"  
  end   if  
  %>

NO.1   作者: yyzzbb_yang

这是不能直接判断的,但是可以通过这种方法来得到它是否是null字段  
  :  
  rs("b")   +""==null

NO.2   作者: muxinpp

if   isnull(rs("b"))

NO.3   作者: aocool

select   *   from   xxx   where   xxx   is   null.  
   
 

NO.4   作者: coffee_cn

<%  
  Set   rs   =   cn.Execute("select   a,b   from   m   where   a=ttt")  
  if   rs("b")   &   "a"   =   "a"   then  
  Response.Write   "hello"  
  end   if  
  %>  
 


 ·怎么在label中换行    »显示摘要«
    摘要: 请问怎么在label中换行?显示多行文本。谢谢! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE