Exemplo n.º 1
0
        public static void Connect(string host, string username, string password, string db, SQLConsole.Data.DATABASETYPES type)
        {
            try
            {
                Program.dbo = new SQLConsole.Data.Database(new SQLConsole.Data.LLDBA(host, username, password, db, type));
                Program.dbo.Open();
                Console.WriteLine("Connected Successfully to: " + db + "@" + host);
                Interpreter.prompt = Program.dbo.GetDatabaseConnector().svrinfo._database + ">";

                return;
            }
            catch {
                Console.WriteLine("Error: Cannot open database connection!");
            }
        }
 public int? getSingleValAsInt(SQLConsole.Data.QueryBuilder queryBuilder)
 {
     queryBuilder.autoExecute = false;
     return getSingleValAsInt(queryBuilder.Compile());
 }
Exemplo n.º 3
0
 public Database(SQLConsole.Data.LLDBA databaseProvider)
 {
     this._dbProvider = databaseProvider;
     if(this._dbProvider.svrinfo._server != null)
         this._tblCache = new TableCache(this);
 }
 public string getSingleVal(SQLConsole.Data.QueryBuilder queryBuilder)
 {
     string sqlSrc = "";
     queryBuilder.autoExecute = false;
     sqlSrc = queryBuilder.Compile();
     sqlSrc = DoTopLevelSqlTranslations(ref sqlSrc);
     return getSingleVal(sqlSrc);
 }
Exemplo n.º 5
0
 public static string Local_StripSlashes(string str, SQLConsole.Data.DATABASETYPES dbType)
 {
     if ((dbType == DATABASETYPES.MSSQL2005) || (dbType == DATABASETYPES.MSSQL))
     {
         return MSSQL_StripSlashes(str);
     }
     else if (dbType == DATABASETYPES.MYSQL)
     {
         return MYSQL_StripSlashes(str);
     }
     else return null;
 }