To enable TCP/IP connection for SQL Server Express edition and add firewall exceptions on a Windows system, follow these steps:
Open SQL Server Configuration Manager.
Navigate to SQL Server Network Configuration > Protocols for [Your SQL Server Instance].
Right-click TCP/IP and select Enable.
Restart the SQL Server service to apply the changes.
Next, add firewall exceptions (only required if SQL Server and Internet Information Server are on different machines or a firewall is enabled):
Click Start, open Control Panel, then go to System and Security.
Within System and Security, click Allow an app through Windows Firewall.
Click Allow another app..., then click Browse.
Add these program paths as exceptions:
C:\Program Files\Microsoft SQL Server\MSSQL16.SQL2022\MSSQL\Binn\SQLServer.exe
C:\Program Files\Microsoft SQL Server\90\Shared\SQLBrowser.exe
Click Add to include each program.
Click OK to save and apply the firewall changes.
This configuration allows SQL Server Express to accept TCP/IP connections and ensures the firewall does not block SQL Server network traffic. Note that if SQL Server and IIS are on the same Windows machine, firewall exceptions may not be necessary.