GetMasterConnectionString() public static method

public static GetMasterConnectionString ( ) : string
return string
Ejemplo n.º 1
0
        private static void DropDatabase()
        {
            var recreateDatabaseSql = String.Format(
                @"DROP DATABASE IF EXISTS `{0}`",
                ConnectionUtils.GetDatabaseName());

            using (var connection = new MySqlConnection(
                       ConnectionUtils.GetMasterConnectionString()))
            {
                connection.Execute(recreateDatabaseSql);
            }
        }
Ejemplo n.º 2
0
        private static void CreateAndInitializeDatabase()
        {
            var recreateDatabaseSql = String.Format(
                @"CREATE DATABASE IF NOT EXISTS `{0}`",
                ConnectionUtils.GetDatabaseName());

            using (var connection = new MySqlConnection(
                       ConnectionUtils.GetMasterConnectionString()))
            {
                connection.Execute(recreateDatabaseSql);
            }

            using (var connection = new MySqlConnection(
                       ConnectionUtils.GetConnectionString()))
            {
                MySqlObjectsInstaller.Install(connection);
            }
        }