首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

errorSystem.NullReferenceException: 未将对象引用设置到对象的实例。该如何解决

2012-01-02 
errorSystem.NullReferenceException: 未将对象引用设置到对象的实例。“/YaqiShop/WebUI”应用程序中的服务

errorSystem.NullReferenceException: 未将对象引用设置到对象的实例。


 
“/YaqiShop/WebUI”应用程序中的服务器错误。
--------------------------------------------

errorSystem.NullReferenceException:   未将对象引用设置到对象的实例。
    在   YaqiShop.BLL.Product.GetProductsBySearch(String   keywords)   位置   C:\Inetpub\wwwroot\YaqiShop\BLL\Product.cs:行号   32  
说明:   执行当前   Web   请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。  

异常详细信息:   System.Exception:   errorSystem.NullReferenceException:   未将对象引用设置到对象的实例。
    在   YaqiShop.BLL.Product.GetProductsBySearch(String   keywords)   位置   C:\Inetpub\wwwroot\YaqiShop\BLL\Product.cs:行号   32

源错误:  


行   34:                           catch(Exception   ex)
行   35:                           {
行   36:                                   throw   new   Exception( "error "   +   ex.ToString());    
行   37:                           }                  
行   38:                                                                                                            
 

源文件:   C:\Inetpub\wwwroot\YaqiShop\BLL\Product.cs         行:   36  

堆栈跟踪:  


[Exception:   errorSystem.NullReferenceException:   未将对象引用设置到对象的实例。
      在   YaqiShop.BLL.Product.GetProductsBySearch(String   keywords)   位置   C:\Inetpub\wwwroot\YaqiShop\BLL\Product.cs:行号   32]
      YaqiShop.BLL.Product.GetProductsBySearch(String   keywords)   in   C:\Inetpub\wwwroot\YaqiShop\BLL\Product.cs:36
      YaqiShop.Web.SearchControl.PageChanged(Object   sender,   DataGridPageChangedEventArgs   e)   in   c:\Inetpub\wwwroot\YaqiShop\WebUI\Controls\SearchControl.ascx.cs:21
      YaqiShop.Web.CustomList.OnPageIndexChanged(DataGridPageChangedEventArgs   e)   in   c:\Inetpub\wwwroot\YaqiShop\WebUI\App_Code\CustomList.cs:145
      YaqiShop.Web.CustomList.SetPage(Int32   index)   in   c:\Inetpub\wwwroot\YaqiShop\WebUI\App_Code\CustomList.cs:69
      YaqiShop.Web.CustomList.OnLoad(EventArgs   e)   in   c:\Inetpub\wwwroot\YaqiShop\WebUI\App_Code\CustomList.cs:76
      System.Web.UI.Control.LoadRecursive()   +47
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.BasePartialCachingControl.LoadRecursive()   +113
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.Control.LoadRecursive()   +131
      System.Web.UI.Page.ProcessRequestMain(Boolean   includeStagesBeforeAsyncPoint,   Boolean   includeStagesAfterAsyncPoint)   +1061



 


[解决办法]
有我在,呵呵。你的问题会解决的,放心吧!

热点排行