Ejemplo n.º 1
0
        public static void InitSqlPort(string ip, string account, string password)
        {
            string strConnection = ConfigurationManager.ConnectionStrings["SqlConnection"].ConnectionString;

            strConnection = string.Format(strConnection, ip, account, password);
            Db            = new SqlHelper(strConnection);
        }
Ejemplo n.º 2
0
        public static void LoadDb(string path)
        {
            if (Db != null)
            {
                return;
            }
            string connectionstring = string.Format(ConfigurationManager.ConnectionStrings["SqliteConnection"].ConnectionString, path);

            Db = new Sqlite(connectionstring);
            if (!File.Exists(path))
            {
                CreateDb(path);
            }
        }
Ejemplo n.º 3
0
        public static void InitSqlitePort(string filepath)
        {
            _DbFilePath = filepath;
            string strConnection = ConfigurationManager.ConnectionStrings["SqliteConnection"].ConnectionString;

            strConnection = string.Format(strConnection, filepath);
            Db            = new SqliteHelper(strConnection);
            if (!File.Exists(filepath))
            {
                string directoryfile = Path.GetDirectoryName(filepath);
                if (!Directory.Exists(directoryfile))
                {
                    Directory.CreateDirectory(directoryfile);
                }
                CreateSqliteDb(filepath);
            }
        }