Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...


Error when Deleting Customer from /inquiry_users.aspx

Storefront version: ML with Source Code

I'm getting an error whenever I try to delete a customer from the Manage User Account page (/inquiry_users.aspx). The error is an Index Out of Range Exception: DownloadEMailSentOn.

From looking at the AppLogic.vb file, when deleting a customer, the program also wants to delete any download folders associated with the CustomerID. Here's the section from AppLogic.vb that I believe is what's causing the issue.

' remove any download folders also:
			Using con As New SqlConnection(DB.GetDBConn())
				Using rso As IDataReader = DB.GetRS("Select ordernumber from orders   with (NOLOCK)  where CustomerID=" & CustomerID.ToString(), con)
					Do While rso.Read()
						If DB.RSFieldDateTime(rso, "DownloadEMailSentOn") <> Date.MinValue Then
							Dim dirname As String = DB.RSFieldInt(rso, "OrderNumber").ToString() & "_" & CustomerID.ToString().ToString()
								System.IO.Directory.Delete(CommonLogic.SafeMapPath("../orderdownloads/" & dirname), True)
							End Try
						End If
				End Using
			End Using

We don't currently sell any downloadable products.

My question is this: Can I just comment out this code so there won't be an exception thrown? If I can, will having this code commented out cause any issues in my database?

Here's the Stack Trace:

Server Error in '/' Application.


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.IndexOutOfRangeException: DownloadEMailSentOn

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[IndexOutOfRangeException: DownloadEMailSentOn]
   System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +6277726
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +249
   AspDotNetStorefrontCore.DB.RSFieldDateTime(IDataReader rs, String fieldname) +432
   AspDotNetStorefrontCore.AppLogic.NukeCustomer(Int32 CustomerID, Boolean BanTheirIPAddress) +957
   ISM_ASPDNF_Utilities.ISM_AspDotNetStorefrontUtilities.estylez_ManageUsers.User_ODS_Delete(Int32 customerID) +147

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +897
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +1009
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +4114064
   System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +1050
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +482
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +110
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

Version Information: Microsoft .NET Framework Version:2.0.50727.5485; ASP.NET Version:2.0.50727.5491


asked Apr 21, 2016 in ML by Potzi (380 points)

1 Answer

0 votes
/inquiry_users.aspx isn't an 'out of the box' file, so take this with a grain of salt (or better yet, find the developer who added it) but if you're not selling downloadable products then there shouldn't be any harm in that.  Worst case is you're left with some files on the server that don't strictly need to be there anymore.
Again, talking to the dev who built that page and whatever other functionality is related to it would be a good idea - those 15 lines don't give us a whole lot of context.
answered Apr 21, 2016 by Vortx ScottS (13,500 points)