Tình huống :
Website đã config đúng thông số kết nói database (ConnectString) đồng thời kiểm tra kết nối DB đều OK, thậm chí khi monitor website truy cập vẫn có log kết nối DB thành công vào con SQL. Tuy nhiên website vẫn bị báo lỗi
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).
Nguyên nhân :
- Vì 1 số lý do gì đó website sử dụng cả khai báo connectionString mặc định của .NET Framework (được khai báo trong file C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config)
Xử lý :
- Trong khai báo connectionString của website thêm thẻ <clear /> vào
<connectionStrings>
<clear />
Không có nhận xét nào:
Đăng nhận xét