您的位置:程序门 -> .net技术 -> c#



在位置 0 处没有任何行。 <在线等待>


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


在位置 0 处没有任何行。 <在线等待>[已结贴,结贴人:aniki2007]
发表于:2007-09-07 10:05:07 楼主
错误信息:
“/erp0905”应用程序中的服务器错误。
--------------------------------------------------------------------------------

在位置   0   处没有任何行。  
说明:   执行当前   web   请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。  

异常详细信息:   system.exception:   在位置   0   处没有任何行。

源错误:  


行   78:                   catch   (exception   ex)
行   79:                   {
行   80:                           throw   new   exception(ex.message);
行   81:  
行   82:                   }
 

源文件:   f:\erp0905\distributiondepartment\contactoperational.aspx.cs         行:   80  

堆栈跟踪:  


[exception:   在位置   0   处没有任何行。]
      distributiondepartment_contactoperational.bind()   in   f:\erp0905\distributiondepartment\contactoperational.aspx.cs:80
      distributiondepartment_contactoperational.page_load(object   sender,   eventargs   e)   in   f:\erp0905\distributiondepartment\contactoperational.aspx.cs:19
      system.web.util.callihelper.eventargfunctioncaller(intptr   fp,   object   o,   object   t,   eventargs   e)   +13
      system.web.util.callieventhandlerdelegateproxy.callback(object   sender,   eventargs   e)   +45
      system.web.ui.control.onload(eventargs   e)   +80
      system.web.ui.control.loadrecursive()   +49
      system.web.ui.page.processrequestmain(boolean   includestagesbeforeasyncpoint,   boolean   includestagesafterasyncpoint)   +3745

---------------------------------------------------------------------------
程序:
        public   datarow   bind()
        {
                if   (mysqlconnection.state   ==   connectionstate.open)
                        mysqlconnection.close();
                mysqlconnection.open();
                sqldataadapter   sa   =   new   sqldataadapter( "select   *   from   contactoperational   where   serial     =   ' "   +   request.querystring[ "id "]   +   " '   ",   mysqlconnection);
                dataset   dr   =   new   dataset();
                sa.fill(dr,   "contactoperational ");

                sa.fill(dr);
                try
                {
                        return   dr.tables[ "contactoperational "].rows[0];

                }
                catch   (exception   ex)
                {
                        throw   new   exception(ex.message);

                }
                finally
                {
                        mysqlconnection.close();
                }

        }
发表于:2007-09-07 10:09:251楼 得分:0
加下判断=0的情况就好了
发表于:2007-09-07 10:16:012楼 得分:0
请详说一下
我刚学,菜,谢谢
发表于:2007-09-07 10:21:253楼 得分:10
if   (dr.tables[ "contactoperational "].rows.count> 0)
{
        return   dr.tables[ "contactoperational "].rows[0];
}
发表于:2007-09-07 10:21:384楼 得分:10
try
                {
                        if(dr.tables[ "contactoperational "].rows.count   >   0)
                        return   dr.tables[ "contactoperational "].rows[0];
                        else   return   null;

                }


快速检索

最新资讯
热门点击