سلام دوستان.
من این connection string رو نوشتم در webconfig
</****=add name="MainConnection" connectionString="DATA SOURCE=**.***.**.**,4431;Initial Catalog=MedexMain;UID=****;PWD>
ولی با این خطا مواجه میشم.
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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
Source Error:
Line 19: oCnn.ConnectionString = MainConnection
Line 20:
Line 21: oCnn.Open()
Line 22:
Line 23: Return oCnn |
enable بودن TCP/IP رو چک کردم.
تیک allow remote connection در sql رو هم زدم.
چند روزه که درگیر این خطام.