This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

run time wrong

when i use vs2012 compile the solution named  DomainReporter  one of  the samples given by WaterObjects.NET,it works successfully, but when i click the button named report ,the bug occur, the wrong message is "  database format not recognized or read-only it could not be opened"  how can i resolve it?

"

Parents
  • the databasefile i use is a file extend name .mdb,i can use access open it
  • Gang,

    Are you using the Access Database (MDB) version of the Waterobjects.NET sample?

    Is the MDB file you're trying to open a valid WaterGEMS model? (does it open in WaterGEMS Standalone?)

    Have you tried placing the file in a location that you have read/write permissions to, and have you tried running your tool as admin?


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

  • Gang,

    If you're using a version of WaterGEMS that uses the .MDB extension for model files (V8i SS3 and below) then you can find example models in the "Samples" folder within the WaterGEMS installation folder.

    If you're using a version of WaterGEMS that uses the .SQLITE extension for model files (V8i SS4 and above), then you'll need the SQLITE version of the Waterobjects.NET SDK (currently in beta). A link can be provided if needed.

    If this does not help, please provide answers to the questions in my previous reply.


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

  • In the "Samples" folder within the WaterGEMS installation folder,there isn't the .MDB extension model files. The code trigger the bug is below:
    GenericDataSource adatasoure =new GenericDataSource ();
    adatasoure .SetConnectionProperty(ConnectionProperty.FileName,DatabasePath);
    adatasoure .SetConnectionProperty(ConnectionProperty.ConnectionType,ConnectionType.Jet4pt0);
    adatasoure .SetConnectionProperty(ConnectionProperty.EnableSchemaUpdate,false);
    adatasoure .Open();//run here the bug occur
  • It sounds like you might be using a SQLITE-based version of WaterGEMS. Can you confirm, by going to Help > About within WaterGEMS Standalone?

    If so I believe you may need the updated SQLITE version of the SDK. I'll confirm and get back to you on this.


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

    Answer Verified By: gang han 

  • the version of WaterGEMS is 2006/1/27 08.11.06.113 64 bits ,but run the program by vs2012,not in WaterGEMS
  • Juts to close the loop on this - I had a private message chat with Gang about this and he was able to utilize the SQLITE model files by changing the code in the sample to use SQLITE instead of MDB (connectiontype from sqljet4pt0 to sqlite). Related article:

    communities.bentley.com/.../23183.how-to-change-a-waterobjects-sample-file-to-use-the-sqlite-format

    A beta release of the WaterObjects.NET SDK is available, with sample files updated as such to work with SQLITE-based model files.


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

Reply Children
No Data