1

I HOST MY ASP.NET WEBSITE ON WEBSERVER ..But after upload when i try to access my site ...

http://www.vbi.volvobusesindia.com

Then following error occurs ....

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 changed my connectionstring in web.config file and all webpages to :

<connectionStrings>
    <remove name="ConnectionString"/>
    <add name="ConnectionString" connectionString="Data Source=69.16.253.19,1433; Network Library=DBMSSOCN; Initial Catalog=database;Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.SqlClient"/>
  </connectionStrings>

...before publishing and uploading my website to webserver ...

I m confused the problem is from my local computer or the webserver ....and how to fix this error ?

ClixNCash
  • 81
  • 1
  • 4
  • 14
  • Can you ping your server from a command prompt from the webserver you are hosting your ASP.NET application from? – s_hewitt Jan 19 '11 at 16:40
  • YA... server ya ...alright ... because i have imported my ASPNETDB.MDF database Tabled to Remote server database .... – ClixNCash Jan 19 '11 at 16:41
  • 2
    More specifically, can you ping your server from a command prompt running ON THE WEB SERVER? (Remote Desktop) – 3Dave Jan 19 '11 at 16:41
  • NO ...m the client they issue me the server id , database name , username and password ... – ClixNCash Jan 19 '11 at 16:43

4 Answers4

2

This means that your web server can't connect talk to the SQL server. Are you sure that the IP is correct, and that the SQL server is configured to accept remote connections over IP?

Can you connect to the database server using SQL Management Studio, using the same username, password and IP address that are in your connection string? Is your application retrieving the correct connection string from web.config?

3Dave
  • 28,657
  • 18
  • 88
  • 151
  • ya...i have connected properly .... and i imported my localhost database tables to the remote host server tables. .. – ClixNCash Jan 19 '11 at 16:44
  • I can run my site locally on my PC by using my REMOTE Sqlserver .... but when i upload my website to server then the following eroor arises /.. – ClixNCash Jan 19 '11 at 16:45
  • @ClixNCash As I've already said, this is most a communications issue between your web server and the database server. – 3Dave Jan 25 '11 at 16:26
1

ASP.NET can't connect to your database - either the address is wrong, or the SQL Server isn't configured to accept remote TCP/IP connections, or (probably more likely) there's a firewall in between that's stopping the traffic from getting through...

Jon
  • 16,212
  • 8
  • 50
  • 62
0

Not sure but might be this: Data Source=69.16.253.19,1433 . If 1433 is the port you are trying to use, write it with a : .69.16.253.19:1433

Lill Lansey
  • 4,775
  • 13
  • 55
  • 77
  • YA i didnt ... but use less ...my site runs on my pc .... if i use remote sql server but my APP_Data database was still their to run the site ...properly ... if i delete ASPNETDB.MDF from App_Data folder then the same error arises in my local pc ... – ClixNCash Jan 19 '11 at 16:48
0

I saw on you other post before they closed it that may have held the key to your problem. I noticed your server was saying cannot find "C:\Users\Ashis..."

It looks to me like your server is using client side code to get the path to the database. Therefore the browser is always looking on the "clients" machine.

You need to use server side script, something like Server.MapPath("mydbname") (c# syntax) to get path of the database.

clamchoda
  • 4,411
  • 2
  • 36
  • 74