How to check SQL Server database is exists using C#.NET
The following method using sys. schema and views such as sys.databases and sys.tables.As we know that the old style sysobjects and sysdatabases and those catalog views have been deprecated since SQL Server. private static bool CheckDatabaseExists(string connectionString, string databaseName) { string sqlQuery; bool result = false; try { ...