Example #1
0
        public override bool Connect(string sql)
        {
            sql            = sql.Replace(SQLITE_LOCAL_DD, NTool.getProjectPath());
            this.SQLiteCon = new SQLiteConnection(sql);
            if (this.SQLiteCon != null && SQLiteCon.State == ConnectionState.Closed)
            {
                this.SQLiteCon.Open();

                return(true);
            }

            return(false);
        }
Example #2
0
 public override bool Open()
 {
     try
     {
         this.SQLiteCon = new SQLiteConnection(base.ConfigStr.Replace(SQLITE_LOCAL_DD, NTool.getProjectPath()));
         if (this.SQLiteCon != null && SQLiteCon.State == ConnectionState.Closed)
         {
             this.SQLiteCon.Open();
             this.msg            = "第一步打开数库库据成功……请继续第二步";
             base.isOpenDataBase = true;
             return(true);
         }
         else
         {
             this.msg            = "第一步打开数据库失败……请查看    ConfigStr:" + this.ConfigStr + "没有异常信息 ";
             base.isOpenDataBase = false;
         };
         //this.Open();
     }
     catch (Exception ex)
     {
         base.isOpenDataBase = false;
         this.msg            = "第一步打开数据库失败……请查看   ConfigStr:" + this.ConfigStr + " 异常信息: " + ex.Message;
     }
     return(false);
 }