// // Initialize() // // Perform the minimum requirement of logging onto the c-tree Server // static void Initialize() { Console.WriteLine("INIT"); try { // initialize connection object conn = new CtreeSqlConnection(); conn.ConnectionString = "UID=ADMIN;PWD=ADMIN;Database=CtreeSql;Server=localhost;Service=6597;"; // initialize command object cmd = new CtreeSqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; // connect to server Console.WriteLine("\tLogon to server..."); conn.Open(); } catch (CtreeSqlException e) { Handle_Exception(e); } catch (Exception e) { Handle_Exception(e); } }
private void Connect() { try { // initialize connection object Connection = new CtreeSqlConnection(); Connection.ConnectionString = Envs.GetTypedEnvVariable <string>("DATABASE_CONNECTION_STRING", "UID=promax;PWD=itax#2021;Database=ctreeSQL_GEO_D2;Server=172.22.6.83;Service=6570;"); // initialize command object Command = new CtreeSqlCommand(); Command.CommandType = System.Data.CommandType.Text; Command.Connection = Connection; Command.Transaction = null; // connect to server Console.WriteLine("\tLogon to server..."); Connection.Open(); } catch (CtreeSqlException e) { HandleException(e); } catch (Exception e) { HandleException(e); } }
internal static IDbConnection GetConnectionObject(EDtxReaderType connType) { IDbConnection conn; switch (connType) { case EDtxReaderType.FaircomAdapter: case EDtxReaderType.FaircomReader: case EDtxReaderType.FaircomReaderSafe: conn = new CtreeSqlConnection(); break; default: case EDtxReaderType.Adapter: case EDtxReaderType.Reader: case EDtxReaderType.ReaderSafe: conn = new OdbcConnection(); break; } return(conn); }
internal static IDbConnection GetConnectionObject(EDtxReaderType connType) { IDbConnection conn; switch (connType) { case EDtxReaderType.FaircomAdapter: case EDtxReaderType.FaircomReader: case EDtxReaderType.FaircomReaderSafe: conn = new CtreeSqlConnection(); break; default: case EDtxReaderType.Adapter: case EDtxReaderType.Reader: case EDtxReaderType.ReaderSafe: conn = new OdbcConnection(); break; } return conn; }