c# - Connecting to SQL Server Database via Visual Studio 2012 -
good day, awesome people! know similar questions have been asked, i've read through many of them without success. here's problem:
i've added data source in visual studios 2012 express (i'm using c#) connecting database created in sql server express 2016. when run project , attempt executing code relating database, error:
an unhandled exception of type 'system.data.sqlclient.sqlexception' occurred in system.data.dll
additional information: network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)."
i connecting locally, not remotely.
i have gone through following:
- on creating connection, "test connection" successful.
- i've quadruple-checked connection string.
- sql server running.
- in sql server management studio properties, remote connection enabled (even though i'm not connecting remotely.)
- in sql server configuration manager, under services, sql server running. under sql server network configuration, shared memory, named pipes , tcp/ip enabled.
my connection string:
data source=name\sqlexpress;initial catalog=(catalog name);integrated security=true
you might need open sql port on firewall 1433.
Comments
Post a Comment