首页上一页 1 下一页尾页 1 条记录 1/1页
System.NullReferenceException: 未将对象引用设置到对象的实例。
发表在ASP.NET图书答疑
2012-06-27
是否精华
是
否
版块置顶:
是
否
异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
源错误:
行 29: public SqlConnection GetConnection()
行 30: {
行 31: string myStr = ConfigurationManager.AppSettings["ConnectionString"].ToString();
行 32: SqlConnection myConn = new SqlConnection(myStr);
行 33: return myConn;
源文件: e:\MrNetShop\App_Code\DBClass.cs 行: 31
堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
DBClass.GetConnection() in e:\MrNetShop_51aspx\App_Code\DBClass.cs:31
UserInfoClass.DGIBind(Int32 P_Int_Deplay, String P_Str_srcTable, DataList DLName) in e:\MrNetShop_51aspx\App_Code\UserInfoClass.cs:384
index.RefineBind() in e:\MrNetShop_51aspx\User\index.aspx.cs:83
index.Page_Load(Object sender, EventArgs e) in e:\MrNetShop_51aspx\User\index.aspx.cs:21
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
请问技术人员,这个问题怎么解决
源错误:
行 29: public SqlConnection GetConnection()
行 30: {
行 31: string myStr = ConfigurationManager.AppSettings["ConnectionString"].ToString();
行 32: SqlConnection myConn = new SqlConnection(myStr);
行 33: return myConn;
源文件: e:\MrNetShop\App_Code\DBClass.cs 行: 31
堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
DBClass.GetConnection() in e:\MrNetShop_51aspx\App_Code\DBClass.cs:31
UserInfoClass.DGIBind(Int32 P_Int_Deplay, String P_Str_srcTable, DataList DLName) in e:\MrNetShop_51aspx\App_Code\UserInfoClass.cs:384
index.RefineBind() in e:\MrNetShop_51aspx\User\index.aspx.cs:83
index.Page_Load(Object sender, EventArgs e) in e:\MrNetShop_51aspx\User\index.aspx.cs:21
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
请问技术人员,这个问题怎么解决