“/student/StudentManager”应用程序中的服务器错误。
--------------------------------------------------------------------------------未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 47:
行 48: ///判断用户是否合法
行 49: if (recu.Read())
行 50: {
行 51: userId = recu["UserID"].ToString();
源文件: c:\Inetpub\wwwroot\stu\StudentManager\Default.aspx.cs 行: 49 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
Default.LoginBtn_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\stu\StudentManager\Default.aspx.cs:49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42
--------------------------------------------------------------------------------未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 47:
行 48: ///判断用户是否合法
行 49: if (recu.Read())
行 50: {
行 51: userId = recu["UserID"].ToString();
源文件: c:\Inetpub\wwwroot\stu\StudentManager\Default.aspx.cs 行: 49 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
Default.LoginBtn_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\stu\StudentManager\Default.aspx.cs:49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42
解决方案 »
- c# 能远程操作软件吗?
- 如何在KeyUp事件中判断是否输入了某字符?
- 第一次在C#版里弱弱地提过关于创建对象实例的问题
- 背景图片很满
- ListView以及图像处理的两个问题!望各位达人能帮忙解决一下
- 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
- 从数据表中读出数据存入文本,如何删除文本中每一行的空格?看下列代码
- 求立象214条码机接口编程代码(多帖高分相送)
- 换一个说法来问一下,关于sqlDataAdapter的问题。
- Session["text"]是什么意思呀?在C++中从没见过这种语法
- 最近和算法干上了,数组算法大讨论拉
- 问个棘手的问题,关于fileSystemWatcher以及文件同步读取
行 50: {
行 51: if(recu["UserID"]!=null)
行 52: userId = recu["UserID"].ToString();
SqlDataReader recu = SqlCommand.ExecuteReader();//重新实例
if(recu.Read())
{
userId = recu["UserID"].ToString();
}