public string CreateDatabase(SQLServerConnectionModel connection) { //string connectionString = DBUtility.BuildConnectionString(connection.ServerAddress, "master", connection.UserName, connection.Password); string result = Provider.SQLServerDatabaseManager().CreateDatabase(connection.ServerAddress, connection.DatabaseName, connection.UserName, connection.Password); return(result); }
public string CheckDatabaseExistency(SQLServerConnectionModel connection) { string connectionString = DBUtility.BuildConnectionString(connection.ServerAddress, "master", connection.UserName, connection.Password); string[] result = Provider.SQLServerDatabaseManager().ListDatabases(connectionString); foreach (var item in result) { if (item.ToLower() == connection.DatabaseName.ToLower()) { return("1"); } } return("0"); }
public string[] ListDatabases(SQLServerConnectionModel connection) { string connectionString = DBUtility.BuildConnectionString(connection.ServerAddress, connection.DatabaseName, connection.UserName, connection.Password); return(Provider.SQLServerDatabaseManager().ListDatabases(connectionString)); }