Hi,
I try to open a SQL connection from my .NET 4.6.1 application to the SQL Server that is running on the host (Windows 10).
In the SQL Server Configuration Manager I enabled TCP/IP and made sure, that the SQL Server ist listening on all IP addresses.
In my Bitdefender (AntiVirus) I enabled Inbound and Outbound connections to the SQL Server default port 1433.
I tried different ConnectionStrings.
With the connection string
server=192.168.204.49\SQLEXPRESS2017,1433;user id=myuserid;password=mypw;initial catalog=mydatabase;MultipleActiveResultSets=True
I receive the error message:
Snix_PreLogin (provider: SNI_PN7, error: 0 - Cannot find the specified file)
Snix_PreLogin (provider: SNI_PN7, error: 0 - Cannot find the specified file)
Snix_PreLogin (provider: SNI_PN7, error: 0 - Cannot find the specified file)
Cannot find the specified fileat System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.UInt32 waitForMultipleObjectsTimeout, System.Boolean allowCreate, System.Boolean onlyOneCheckConnection, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x00085] in :0
- at System.Data.ProviderBase.DbConnectionPool.TryGetConnection*
After I changed the connection string to
server=host.docker.internal\SQLEXPRESS2017,1433;user id=myuserid;password=mypw;initial catalog=mydatabase;MultipleActiveResultSets=True
I get the following error:
System.Data.SqlClient.SqlException (0x80131904): Snix_PreLogin (provider: SNI_PN7, error: 0 - Cannot find the specified file)
Snix_PreLogin (provider: SNI_PN7, error: 0 - Cannot find the specified file) —> System.ComponentModel.Win32Exception (0x80004005): Cannot find the specified file
I start the container with the following command:
docker run -i -t -p 1433:1433 [tagged name]
What can I do to enable the connection from the Docker Containers .NET 4.6.1 application to my local SQL Server?
Regards,
Christian