Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I used vs web developer to build my first website. i've been following the walkthroughs, everything has sort of been going swimmingly...or as swimmingly as someone fyling by the seat of their pants can go...and now i'm trying to learn how to deploy.

as mentioned in the title, i'm using hostgator. the site uses the createuserwizard and the login controls. for some reason, those controls do not work. however, i can add new records to the database, the gridview and datasearches by way of stored procedures all work.

this is the error i get when i try to login/create a new user:

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)

any help would be greatly appreciated i don't know what to do and i'm sorry to say but this is my first time trying to build a site of this nature.
Posted

1 solution

these were my original connection strings...

XML
<add name="connStr" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<add name="ASPNETDBConnectionString" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<add name="ConnectionString" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<remove name="LocalSqlServer" />
<add name="LocalSqlServer">connectionString="connStr" providerName="System.Data.SqlClient" />
</add>


what i should have had...

XML
<add name="connStr" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<add name="ASPNETDBConnectionString" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<add name="ConnectionString" connectionstring="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providername="System.Data.SqlClient" />

<remove name="LocalSqlServer" />
<add name="LocalSqlServer">connectionString="Server=[serverip]; Database=db; User Id=user; Password=pass; Initial Catalog=db" providerName="System.Data.SqlClient"/>
</add>


the bolded section in the LocalSqlServer string is the fix.
 
Share this answer
 

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