How to change a WaterObjects sample file to use the SQLite format


 Product(s):WaterObjects.NET
 Version(s):08.11.00.06
 Environment:N\A
 Area:N/A
 Subarea:

N\A

Original Author:

Scott Kampa

 

Problem

How to change a WaterObjects sample file to use the SQLite format

Steps to Accomplish

Some sample files for WaterObjects.NET currectly use the Microsoft Access .MDB file format. For user's with the latest version of WaterObjects, they may want these converted to the SQLite format, which is used by the latest versions of the Hydraulics and Hydrology products. The below steps can be used to do this conversion.

NOTE: a beta release of the Waterobjects.NET SDK is available (08.11.05.XX), with updated sample files that include this change, so as to work with SQLITE-based model files instead of MDB. Please contact technical support for this version, or check the Fulfilment Center (download site) for an update version.


 - Change ConnectionType.Jet4pt0 to: ConnectionType.Sqlite.
 - And search for occurrences of .mdb within the source files and replace them with .SQLite.

 e.g.
 =MDB===============================
 private void OpenDataSource() //Open MDB
 {
 CloseDataSource();
 if (IsDomainInputFile)
 {
 m_idahodatasource = new IdahoDataSource();
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.FileName, InputFilePath);
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.ConnectionType, ConnectionType.Jet4pt0);
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.EnableSchemaUpdate, false);
 IdahoDataSource.Open();
 }
 }
 =SQLite=============================
 private void OpenDataSource() //open SQLite
 {
 CloseDataSource();
 if (IsDomainInputFile)
 {
 m_idahodatasource = new IdahoDataSource();
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.FileName, InputFilePath);
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.ConnectionType, ConnectionType.Sqlite);
 IdahoDataSource.SetConnectionProperty(ConnectionProperty.EnableSchemaUpdate, false);
 IdahoDataSource.Open();
 }
 }

 =MDB===============================
 static private readonly string DOMAIN_DATABASE_EXTENSION = ".mdb";
 static private readonly string RUNNER_REPORT_EXTENSION = ".rpt";
 static private readonly string RUNNER_OUTPUT_EXTENSION = ".out";
 static private readonly string INPUT_FILES_FILTER = "Input Files (*inp;*.mdb)|*inp;*.mdb";
 =SQLite=============================
 static private readonly string DOMAIN_DATABASE_EXTENSION = ".sqlite";
 static private readonly string RUNNER_REPORT_EXTENSION = ".rpt";
 static private readonly string RUNNER_OUTPUT_EXTENSION = ".out";
 static private readonly string INPUT_FILES_FILTER = "Input Files (*inp;*.sqlite)|*inp;*.sqlite";

See Also

WaterObjects.NET