Solved

# Unable to get shopping cart working on shared hosting site

Posted on 2013-01-10
701 Views
I created a simple shopping cart for a restaurant and when I test it locally it works fine on my computer.  However when I upload it to the server I receive the following error

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)

Line 19:     public virtual ShoppingCart.Cart SCart {
Line 20:         get {
Line 21:             return ((ShoppingCart.Cart)(this.GetPropertyValue("SCart")));
Line 22:         }
Line 23:         set {

I do feel that my connection settings in the config file are correct since I am able to view information from the database, and insert information.

The problem occurs when I click on the "Add to Shopping Cart" button which calls on a temporary class and for some reason it does not work when I try it on the hosting server

Can someone please help me I've looked at this for awhile now and I can't figure it out.

Also it seems that on the source file that the code is trying to create a temporary class.  It seems that is what is throwing the error

Source File: c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a4671715\bf5a33a7\App_Code.8nkl1ye6.5.cs    Line: 21

I think part of it might have to do with my web.config file which has the following settings
<system.web>
<webParts enableExport="true"></webParts>
<customErrors mode="Off"/>
<authorization>
<allow users="?"/>
</authorization>
<roleManager enabled="true"/>
<authentication mode="Forms"/>
<anonymousIdentification enabled="true"/>
<profile enabled="true">
<properties>
<add name="SCart" serializeAs="Binary" type="ShoppingCart.Cart" allowAnonymous="true" />

</properties>
</profile>
<compilation targetFramework="4.0" debug="true">
<assemblies>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<clear />
</namespaces>
</pages>
</system.web>


BTW - I'm using GoDaddy Shared Hosting Plan
0
Question by:Ru1995
• 3
• 2

LVL 23

Assisted Solution

Roopesh Reddy earned 500 total points
ID: 38765996
0

Author Comment

ID: 38766046
Yes I did see that page earlier and I followed the advice that was given but then I received a " Login failed for user 'PHX3\Iusr_9046331'." error

I couldn't find anything on that.  Do you have any other suggestions?
0

LVL 83

Expert Comment

ID: 38766105
Godaddy database servers are not on the same machine as your web hosting files, they are on their own dedicated machines.  You need to go to your hosting admin page and look for the correct info for your SQL server hostname and login.
0

LVL 23

Accepted Solution

Roopesh Reddy earned 500 total points
ID: 38769322
0

Author Comment

ID: 38775976
Sorry I haven't posted on this for awhile I had to take a break.  I'll see if roopeshreddy post works and get back to everyone
0

Author Closing Comment

ID: 38776860
Thanks for all the help it turned out the configuration setting for the aspnetdb were wrong and I just reconfigured it to point towards the main sql server database instead
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…