oraCmd.Parameters.Add(":OrgLevel",strOrgLevel.tostring);

解决方案 »

  1.   

    if strOrgLevel="" then
      strOrgLevel = nothing
    end if
      

  2.   

    sorry, that is wrong.strOrgLevel = "''"
      

  3.   

    1)to  YAOTIEBING(我爱我家) 
        strOrgLevel是string变量,我省了strOrgLevel=txt_OrgLevel.Text 所以不是这个问题。
    2)to xavier_lee(我自横刀哈哈笑!)
        strOrgLevel="''"的结果是把两个单引号放进了这个字段
    3)to  ylc001(白面包青天) 
        该字段的默认值我就是要是空
      

  4.   

    先判断一下,如果为空就不添加或者添加System.DBNUll.Value
      

  5.   

    to  gOODiDEA(无语) :
    1)不添加不行的。
    2)添加System.DBNUll.Value也不行。我那个字段有时也必须为空的,不能这样做很烦。
    在SQL SERVER里面没有这个问题,但是给出错提示的不是ORACLE,因为如果是ORACLE出错是显示“ORA-01008:”之类的提示的,它是单纯的.NET出错提示