当前位置: 代码迷 >> ASP.NET >> 小弟我的一个查询语句,再没有使用存储过程时,用的好好的,使用存储过程后出现:未将对象引用设置到对象的实例
  详细解决方案

小弟我的一个查询语句,再没有使用存储过程时,用的好好的,使用存储过程后出现:未将对象引用设置到对象的实例

热度:7496   发布时间:2013-02-26 00:00:00.0
我的一个查询语句,再没有使用存储过程时,用的好好的,使用存储过程后出现:未将对象引用设置到对象的实例

我的一个查询语句,再没有使用存储过程时,用的好好的,使用存储过程后出现:未将对象引用设置到对象的实例

Dim   strsql   As   String   =   "select   tbsptm.f_sptm   sptm,tbspda.f_spmc   spmc,c.qmsl, "   &   _
                                "(c.qmsl*tbspda.f_xsdj)   qmje,(tbspda.f_zhjj*(1+tbspda.f_sl/100))   zhjj,tbspda.f_xsdj   xsdj,c.qmsl*(tbspda.f_zhjj*(1+tbspda.f_sl/100))   qmjjje   from   "   &   _
                                "(select   a.f_spbm   spbm,(a.qcsl+b.fssl)   qmsl   from   (select   f_spbm,sum(f_qcsl)   qcsl,sum(f_qcje)   qcje   from   "   &   bbb   &   "_yhj   where   f_bmbm   like   ' '% ' '   and   f_spbm   in   "   &   _
                                "(select   f_spbm   from   tbsptm   where   f_xh= ' '1 ' '   and   f_sptm   like   ' '% ' '   and   f_spbm   in   (select   f_spbm   from   tbgysdz   where   f_gysbm= ' ' "   &   userid   &   " ' '))   group   by   f_spbm)   a, "   &   _
                                "(select   f_spbm,(sum(f_jhsl)+sum(f_Brsl)+sum(f_Sysl)+sum(f_Pssl)-sum(f_Xssl)-sum(f_Bcsl)-sum(f_Shsl)-sum(f_Phsl))   fssl   from   "   &   bbb   &   "_rhj   where   f_rq <= ' ' "   &   rq2   &   " ' '   "   &   _
                                "and   f_bmbm   like   ' '% ' '   and   f_spbm   in   (select   f_spbm   from   tbsptm   where   f_xh= ' '1 ' '   and   f_sptm   like   ' '% ' '   and   f_spbm   in   (select   f_spbm   from   tbgysdz   where   f_gysbm= ' ' "   &   userid   &   " ' ')) "   &   _
                                "group   by   f_spbm)   b   where   a.f_spbm=b.f_spbm)   c,tbspda,tbsptm   where   c.spbm=tbspda.f_spbm   and   c.spbm=tbsptm.f_spbm   and   tbsptm.f_xh= ' '1 ' '   and   f_sptm   like   ' '% ' '   order   by   tbsptm.f_sptm "

                        strsql   =   "exec   ProcGetPage   ' "   &   strsql   &   " ', '1 ', '10 ' "
                        dr   =   hsjdata.readrow(strsql)
                          Dim   dt   As   DataTable   =   New   DataTable
                        dt   =   hsjdata.ConvertDataReaderToDataTable(dr)
  相关解决方案