Posts

Showing posts from January, 2018
Image
C# ASMX - How to read a Username and Password from Web.config In your Web.config - add the <appSettings>  section In your code, add the following string FaxCoreUsername = System.Configuration.ConfigurationManager.AppSettings[ "FaxCoreUsername" ]; string FaxCorePassword = System.Configuration.ConfigurationManager.AppSettings[ "FaxCorePassword" ]; You can now use the FaxCoreUsername and FaxCorePassword to authenticate long userID = faxSender.AuthenticateUser(FaxCoreUsername, FaxCorePassword);

SQL Server Error “A Network Related or instance-specific Error: 40”

Image
SQL Server Error “A Network Related or instance-specific Error: 40” Problem description When trying to make a connection from Visual Studio Entity Framework Connection Wizard to the local instance of the SQL Server - You get The Error: 40 Make sure that the SQL Server is configured to Allow remote connections (go to SQL Server Management Studio > Properties > Connections) Make sure that the firewall is opened:   netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT Open Sql Server Configuration Manager and SQL Server Services and make sure that the SQL Server Browser is up and running Go to Protocols for YOURINSTANCE Right click on TCP/IP (make sure it’s Enabled) and go to properties Select the IP Address tab and scroll down to the bottom If the TCP Port is empty then make sure to enter 1433 Now hit Apply and OK and restart you...