Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public virtual ShoppingCartExample.Cart SCart {
       get {
           return ((ShoppingCartExample.Cart)(this.GetPropertyValue("SCart"))); // <--- This is the error//
       }
     set {



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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)






I uploaded the website in smarterasp.net and everytime I viewed my shopping cart this the problem. Any help? Thanks in advance.
Posted

1 solution

The error is not directly related to this line. If you search the error with google (https://www.google.com.tr/search?q=A+network-related+or+instance-specific+error+occurred+while+establishing+a+connection+to+SQL+Server&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gfe_rd=cr&ei=gTEUU9SlF8Pb8ge65YDwCw[^]), you will see that you are unable to connect sql-server db with the connection string that you write. Check your connection string, try to connect the database with SSMS using username/passwd in that connection string to test their correctness.
 
Share this answer
 
Comments
DLSU-D Student 4-Mar-14 21:23pm    
Connection string is okay. Only this part is not okay.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900