Sushrut Shastri
Sushrut Shastri

Reputation: 9

Connection String Error after uploading on Godaddy (ASP.NET)

I have created a login application using ASP.NET and SQL Server. It runs perfectly on my localhost but as soon as I uploaded it on GODADDY, I got the ERROR regarding the connection string.

I have also changed the connection string with the one provided by GODADDY but it did not work.

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

Exception Details: System.Data.SqlClient.SqlException: 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 have made DLL and BLL namespaces to which i gave reference of my asp.net application.

I have used connection string in two files (1) in DLL/clsdll.cs file (2) in web.config file as follows

Connection String in clsdll.cs file :-

con = new SqlConnection("Data Source=XXXX;Integrated Security=False;User ID=ZZZZZ;Password=YYYYY;Initial Catalog=demo1;Connect Timeout=15;Encrypt=False;Packet Size=4096");

Connection String in WEB.CONFIG file :-

<connectionStrings>
    <add name="SampleConnectionString" 
         connectionString="Data Source=XXXX;Integrated Security=SSIP;User ID=ZZZZZ;Password=YYYYY;Initial Catalog=demo1;Connect Timeout=15;Encrypt=False;Packet Size=4096"/>
</connectionStrings>

The connection string above is the one provided by GODADDY but it doesn't work.

Can anyone help me out with this please....

Upvotes: 0

Views: 769

Answers (2)

marc_s
marc_s

Reputation: 754993

Well, in your web.config, you have both the "Integrated Security" (with a spelling typo - it should be Integrated Security=SSPI) as well as an explicit username/password.

Don't do that - either you use integrated security (unlikely, in a hosted environment), or then you use user ID=.../Password=... - but don't enable BOTH at the same time!

In your case, I would try

<connectionStrings>
    <add name="SampleConnectionString" 
         connectionString="Data Source=XXXX;Initial Catalog=demo1;User ID=ZZZZZ;Password=YYYYY;"/>
</connectionStrings>

Upvotes: 0

Hirav Sampat
Hirav Sampat

Reputation: 196

only this much info is required you can remove the rest and try once

data source=XXXX;user id=XXXX; password=XXXX; initial catalog=XXXX;

Upvotes: 1

Related Questions