Tuesday, February 07, 2012
  Search
Support Forum
Form Master 1.6.05 Throws a "System.Data.DuplicateNameException" when running a report
Last Post 03 Oct 2009 04:02 PM by Code 5. 8 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Wakefly
New Member
New Member
Send Private Message
Posts:4


--
17 Nov 2008 04:19 PM  
Form Master 1.6.05 gives the following error when trying to run a report:

Error: Form Master Edit is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: A column named 'address 2' already belongs to this DataTable. ---> System.Data.DuplicateNameException: A column named 'address 2' already belongs to this DataTable. at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table) at System.Data.DataColumn.set_ColumnName(String value) at Code5Systems.FormMaster.Business.FormDataController.GetDataSetFromFormResults(String xml, String modulePath, Boolean fromControl) at Code5Systems.FormMaster.Business.FormDataController.List(Int32 moduleId, DateTime dtStart, DateTime dtEnd, Int32 pageNum, Int32 pageSize, String modulePath, Boolean fromControl) at Code5Systems.FormMaster.FormReport.BindGrid() --- End of inner exception stack trace ---

Please help.

Thanks!


Sujay
Basic Member
Basic Member
Send Private Message
Posts:382


--
17 Nov 2008 04:23 PM  
Hi,

Please try this one
http://www.code5systems.com/Support...fault.aspx

Thanks & Regards,
Sujay


Wakefly
New Member
New Member
Send Private Message
Posts:4


--
17 Nov 2008 05:24 PM  
I think I have identified the cause of the problem. The xml in the database adds an underscore to a field name if its a duplicate but the export function "GetDataSetFromFormResults" strips out the underscore so the name becomes a duplicate again:

current.ColumnName = current.ColumnName.Replace("_", " ").Trim();

Can we get a patch for this?


Code 5
Moderator
Advanced Member
Advanced Member
Send Private Message
Posts:907


--
17 Nov 2008 10:49 PM  
The problem with this issue is we have never been able to reproduce it in the development environment.

Could you please export your form and zip it up with a file from your server from

\DesktopModules\Code5Systems_FormMaster\assets\xslt\FormResultsDataSet.xslt

Thanks


Wakefly
New Member
New Member
Send Private Message
Posts:4


--
18 Nov 2008 03:24 PM  
attached is the exported form and the xslt files.

Attachment: 1111824163871.zip

Wakefly
New Member
New Member
Send Private Message
Posts:4


--
20 Nov 2008 03:54 PM  
Can you pleas provide me with a status update for this problem?

Thanks


Code 5
Moderator
Advanced Member
Advanced Member
Send Private Message
Posts:907


--
20 Nov 2008 06:26 PM  
We have examined your export and it was fine. We have not been able to reproduce the problem but are still working on it.


st-pfunk
New Member
New Member
Send Private Message


--
02 Oct 2009 06:53 PM  
I have this problem and here's how I have reproduced it on 2 systems:

1) Create a form with a text field named "Purchase Price".
2) Collect submissions.
3) Change the field label on the text field to "Purchase Price ($)" (no quotes of course).
4) Collect more submissions.
5) Run a report for download to Excel for a date range that covers all submissions.
6) Observe in the browser window "A column named 'Purchase Price' already belongs to this DataTable.  Please Use your Browser Back button to Return"

That should be a sufficient reproduction.  Using the Data -> View report type, you see the exception as follows:

Error: Form Master Edit is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: A column named 'Purchase Price' already belongs to this DataTable. ---> System.Data.DuplicateNameException: A column named 'Purchase Price' already belongs to this DataTable. at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table) at System.Data.DataColumn.set_ColumnName(String value) at Code5Systems.FormMaster.Business.FormDataController.GetDataSetFromFormResults(String xml, String modulePath, Boolean fromControl) at Code5Systems.FormMaster.Business.FormDataController.List(Int32 moduleId, DateTime dtStart, DateTime dtEnd, Int32 pageNum, Int32 pageSize, String modulePath, Boolean fromControl) at Code5Systems.FormMaster.FormReport.BindGrid() --- End of inner exception stack trace ---

Running DNN 4.8.4 with FormMaster 1.6.5 on Win2003 Server with SQL Server 2005 Express.


Code 5
Moderator
Advanced Member
Advanced Member
Send Private Message
Posts:907


--
03 Oct 2009 04:02 PM  

Thanks for the post.

The issue is that ($) are invalid characters for Data Columns. Since this version of Form Master uses the Label as the Column name it must remove these characters before storing them. In addition, since data is stored in XML fragments spaces in the label name are replaced with underscores.

Purchase Price becomes Purchase_Price
Purchase Price ($) becomes Purchase_Price_

When the data is retrieved from the database all individual XML fragments are combined into one XML document. This document is then transformed using XSL transformation into a format which can be loaded by an ADO DataSet.

Next we iterate the column collection and replace the underscores with spaces and trim in trailing spaces, which then gives us duplicate Purchase Price column.

I have coded a hotfix which wll flag and merge the two columns. You will need to be running version 1.6.6 which is available on Snowcovered.com Patches and HotFixes. Also here in Customer Downloads if you have been registered during the purchase process.



You are not authorized to post a reply.

Active Forums 4.2
Copyright 2004-2012 Code 5 Systems, LLC.