in

The ORM Foundation

Get the facts!

DB Import Error

Last post 09-29-2009 11:43 by Matthew Curland. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-22-2009 12:48

    DB Import Error

    Hey guys, I am trying to use the DB Import function to look at an existing database schema. I do the following: 

    Go to File > New File and select Object-Role Modeling (DB Import) fromt he General category

    Choose Microsoft SQL Server as the Data Source with .NET Framework Data Provider for SQL Server as the Data Provider (I've tried with OLE DB as well)

    Select my database in the Connection Properties window (Test Connection succeeds)

    Hit OK and get "There was an error generating the XML document."

    I have tried doing this on the Northwind and pubs database and in those I get the error "Cannot load 'C:\DOCUME~1\ryan\LOCALS~1\Temp\~vs58B.orm': Data at the root level is invalid. Line 1, position 1."

    Opening that file reveals it contains "$DcilFile$" followed by 2 new lines.

    I am using Visual Studio 2008 Professional Edition (9.0.30729.1) SP1 and .NET Framework 3.5 SP1 on an XP machine.

    I am running the July 1, 2009 build of NORMA, including Natural ORM Architect for Visual Studio 2008 and Neumont PLiX for Visual Studio. I can create a new ORM file from scratch and save and reopen it just fine.

    Thanks.

    Filed under: ,
  • 09-25-2009 9:21 In reply to

    Re: DB Import Error

    Hi Ryan,

    Thanks for your post. Matt is extremely busy at the moment but I'm sure that he will respond soon.

    Ken 

  • 09-28-2009 23:15 In reply to

    Re: DB Import Error

    Hi Ryan,

    Sorry for the delay, I've been a little snowed under. 

    This code has not changed in quite a while, and I'm not seeing this error text in the import project code, so I'm not sure what is happening. The code responsible for replacing the '$DcilFile$' placeholder to give you a valid xml document that can be imported is the RunStarted method in Tools\DatabaseImport\ORMDatabaseImportWizard.cs. A quick look at this file indicates that you will (incorrectly) get a message along these lines if the database has no schema in it. I will change this to show an appropriate message in this case.

    However, I'm not sure if this is what you're hitting because it only happens with minimal file. I might need to have you step through the function and see what is going on with your installation. Be careful with this because you don't want to do a build of the main packages on top of a setup build. However, the database import dll will work fine if you don't run build or firsttimebuild

    1. Open a VS2008 command prompt
    2. set TargetVisualStudioVersion=v9.0
    3. Find the root of the source and run builddevtoolsvs2008
    4. Comment out line 35 of SetupEnvironment.bat (use two hyphens like the other comment lines)
    5. cd Tools\DatabaseImport
    6. devenv DatabaseImport.VS2008.sln
    7. Build the solution
    8. Launch a second devenv from the command line
    9. In the VS instance launched in 7, attach to the other process (Ctrl-Alt-P, select devenv.exe)
    10. Put a breakpoint on the RunStarted function mentioned above and proceed with your scenario.

    I'm sorry I don't have a better answer on this, but I would like to see what scenario is stopping you from proceeding with the import. Let me know what you find.

     -Matt

  • 09-29-2009 11:43 In reply to

    Re: DB Import Error

    Ryan,

    Sorry, I missed a couple of steps here.

    Visual Studio resolves its new file wizards through the Global Assembly Cache, but the build process does not copy the .pdb (debug symbol files) to the GAC. Before you can do step 11:

    1. Start the import scenario to load the database import dll into the process (file/new DB import, get the initial dialog, then cancel).
    2. In the attached debugger, open the Modules window (usually Ctrl-Alt-U, under the Debug/Windows menu).
    3. Locate ORMSolutions.ORMArchitect.DatabaseImport.VS2008.dll
    4. Right click on the row and choose 'Load Symbols'. The symbol file you need is in the Tools\DatabaseImport\bin\Debug in the NORMA code structure.

    You should now be able to set the breakpoint in 11.

    -Matt

Page 1 of 1 (4 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service