Click here to Skip to main content
15,920,468 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
using System;
using System.Web;
using System.Web.Profile;



public class ProfileCommon : System.Web.Profile.ProfileBase {
    
    public virtual ShoppingCartExample.Cart SCart {
        get {
            return ((ShoppingCartExample.Cart)(this.GetPropertyValue("SCart"))); //<-- I GET AN ERROR HERE//
        }
        set {
            this.SetPropertyValue("SCart", value);
        }
    }
    
    public virtual ProfileCommon GetProfile(string username) {
        return ((ProfileCommon)(ProfileBase.Create(username)));
    }
}


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)
Posted

The error is very clear. It is not able to connect the the SQL server you have specified. Check your connection string.
 
Share this answer
 
Comments
DLSU-D Student 7-Mar-14 10:29am    
I can access my database only the CART side not accessible.
DLSU-D Student 7-Mar-14 10:30am    
cellzonecharles-001-site1.smarterasp.net/Default.aspx

Check this out. My connection to database is working only the CART cannot access.
AnvilRanger 7-Mar-14 10:52am    
Is what you are calling "Cart" your code or from somewhere else? You need to step into Cart function to see what is going on. More then likely it looks like it will be using a connection string that is different from the rest of your app.
DLSU-D Student 7-Mar-14 11:03am    
Im using one database only. It is possible that it has a 2 connection string? In Local Host its perfectly running but when I upload it to host it shows that error.
The error itself suggests something.
Quote:
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.

So check the connection between your database and your application i.e the connection string.

-KR
 
Share this answer
 
Comments
DLSU-D Student 7-Mar-14 10:29am    
cellzonecharles-001-site1.smarterasp.net/Default.aspx

Check this out. My connection to database is working only the CART cannot access.
Krunal Rohit 7-Mar-14 10:30am    
What should I do with this ?

-KR
Krunal Rohit 7-Mar-14 11:04am    
Dont share your credentials like this. First try with yourself.
And one thing as well, we dont have any access to your code or database. So if you are stuck at somewhere, let us know. We'd solve your issue.

-KR
DLSU-D Student 7-Mar-14 11:08am    
Dont worry KR it just a sample credentials. :) Im just using that for my school project. Im just want you to try so that you can know that connection string is okay only the CART part is not.

Krunal Rohit 7-Mar-14 11:09am    
Then there might be issue with your "Cart" code.

-KR

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