quinnipiac0807
Programmer
I have a form, and when I click the Submit button I get this error.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 130:
Line 131: projecttask.TaskOrderID = Convert.ToInt32(ddlTaskOrder.SelectedItem.Value);
Line 132: projecttask.ProjectDescID = Convert.ToInt32(ddlProjectDesc.SelectedItem.Value);
Line 133: projecttask.Save(iProjectTaskID);
Line 134:
Source File: c:\inetpub\ Line: 132
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Usis.briefCASE.psd.ProjectDetail.SubmitForm() in c:\inetpub\ Usis.briefCASE.psd.ProjectDetail.btnPost_Click(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
The code on line 132 is where I get the error, but line 131 works fine. Does anyone have any idea why this is doing this or have any suggestions?
Thanks in advance
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 130:
Line 131: projecttask.TaskOrderID = Convert.ToInt32(ddlTaskOrder.SelectedItem.Value);
Line 132: projecttask.ProjectDescID = Convert.ToInt32(ddlProjectDesc.SelectedItem.Value);
Line 133: projecttask.Save(iProjectTaskID);
Line 134:
Source File: c:\inetpub\ Line: 132
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Usis.briefCASE.psd.ProjectDetail.SubmitForm() in c:\inetpub\ Usis.briefCASE.psd.ProjectDetail.btnPost_Click(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
The code on line 132 is where I get the error, but line 131 works fine. Does anyone have any idea why this is doing this or have any suggestions?
Thanks in advance