I'm using WCF + SQLServer, when I run it through Visual Studio it works perfectly, when I publish and update in IIS an error occurs:
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) "
I have already followed several forums and tutorials for connection like:
but none worked, complete error follows:
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.ServiceModel.FaultException '1 [[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089]]: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
[FaultException '1: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (IMessage reqMsg, IMessage retMsg) +153
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData & msgData, Int32 type) +336
IntelligenceWCF.SistemasAT6WCF.IService1.RecoverData (String instruction) +0
IntelligenceWCF.SistemasAT6WCF.Service1Client.RecoverData (String instruction) in c: ... WCF.WCF.receberWCF (String query) in c: ... IntelligenceWCF.GCLogin.lnkAcessar_Click (Object sender, EventArgs e) in c: ...
System.Web.UI.WebControls.LinkButton.OnClick (EventArgs e) +116
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent (String eventArgument) +106
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postData) +9754102 System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3562