locked
ExcelImporter extention wont import after pressing refresh RRS feed

  • Question

  • I followed the instructions here to add excel importing to one of my screens.  However, if I import a CSV file and then click refresh and import the same CSV file again it will give this error after mapping the columns:

    "An error occurred while running the screen.  You can close the screen or ignore the error and continue using the screen.  Error details: Entity 'LocatingFacility: 1' cannot be attached to this EntityContainer because it is already attached to another EntityContainer.

    Is this a bug?

    Friday, September 16, 2011 6:56 PM

Answers

All replies

  • I followed the instructions here to add excel importing to one of my screens.  However, if I import a CSV file and then click refresh and import the same CSV file again it will give this error after mapping the columns:

    "An error occurred while running the screen.  You can close the screen or ignore the error and continue using the screen.  Error details: Entity 'LocatingFacility: 1' cannot be attached to this EntityContainer because it is already attached to another EntityContainer.

    Is this a bug?


    I would try with a more recent extension, which is the Office Integration Pack

    http://blogs.msdn.com/b/lightswitch/archive/2011/09/13/grid-logic-releases-the-office-integration-pack-for-lightswitch.aspx

    This also enables importing from Excel with one line of code.


    Alessandro Del Sole
    Microsoft MVP - Visual Basic: development
    http://community.visual-basic.it/alessandro/
    • Marked as answer by Joel McBeth Monday, September 19, 2011 2:37 PM
    Sunday, September 18, 2011 4:10 PM
  • The Office Integration Pack does not have the issue that the ExcelImporter does.  Using it instead solves my issue.

    I did notice it is slower and gives little user feedback while it is importing.  For example, it will take 10-20 seconds to load an excel file, during which there is no indication that it is doing anything other than the loading icon in the screen's tab.

    That's better than not working at all, though.  Thanks!

    Monday, September 19, 2011 2:36 PM