From eed95f193dd92fec9ed5f37d5c12ce1835963e0e Mon Sep 17 00:00:00 2001 From: Loretta Date: Sun, 12 Jul 2026 08:36:14 +0200 Subject: [PATCH] Set console title based on DB environment (DEV/PROD) Added SetConsoleTitleFromCatalog to detect the database environment from the connection string and set the console window title to [PROD] or [DEV] accordingly. Throws on ambiguous catalog names and prints a red warning for production. Switched appsettings.json to use the DEV database. Added Microsoft.Data.SqlClient for connection string parsing. This reduces risk of accidental operations on the wrong database. --- Presentation/Nop.Web/App_Data/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Presentation/Nop.Web/App_Data/appsettings.json b/Presentation/Nop.Web/App_Data/appsettings.json index ebb97bd3..1682296c 100644 --- a/Presentation/Nop.Web/App_Data/appsettings.json +++ b/Presentation/Nop.Web/App_Data/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "ConnectionString": "Data Source=100.73.220.50;Initial Catalog=FruitBank_PROD;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=v6f_?xNfg9N1;Trust Server Certificate=True", + "ConnectionString": "Data Source=100.73.220.50;Initial Catalog=FruitBank_DEV;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=v6f_?xNfg9N1;Trust Server Certificate=True", "DataProvider": "sqlserver", "SQLCommandTimeout": null, "WithNoLock": false