Get this error when setting the value in a row being added to a datatable. Is only caused by the listbox control 'ProductDefinitionList', not the dropdown list control???????
==========================================================
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 56: ' Create a new row in the DataTable and fill with values from page controls
Line 57: objDataRow = myDataTable.NewRow()
Line 58: objDataRow("ProductDefinitionID" = ProductDefinitionList.SelectedItem.Value
Line 59: objDataRow("CategoryID" = CategoryList.SelectedItem.Value
Line 60: objDataRow("Description" = "test3"
Source File: C:\C2K\WAF\PortalVB\admin\register2.aspx Line: 58
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP.Register2_aspx.AddBtn_Click(Object sender, EventArgs E) in C:\C2K\WAF\PortalVB\admin\register2.aspx:58
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() +1263
=========================================================
thanks guys,
si
==========================================================
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 56: ' Create a new row in the DataTable and fill with values from page controls
Line 57: objDataRow = myDataTable.NewRow()
Line 58: objDataRow("ProductDefinitionID" = ProductDefinitionList.SelectedItem.Value
Line 59: objDataRow("CategoryID" = CategoryList.SelectedItem.Value
Line 60: objDataRow("Description" = "test3"
Source File: C:\C2K\WAF\PortalVB\admin\register2.aspx Line: 58
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP.Register2_aspx.AddBtn_Click(Object sender, EventArgs E) in C:\C2K\WAF\PortalVB\admin\register2.aspx:58
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() +1263
=========================================================
thanks guys,
si