GetDatabaseName() public static méthode

public static GetDatabaseName ( ) : string
Résultat string
Exemple #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);
            }
        }
Exemple #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);
            }
        }