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); }
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); } }
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); } }