2

I have uploaded my website to my webhost and it works great except the form authorication. When i try to login at get this 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)

When i deploy the website i publish it from Visual Studio to a local folder and then upload it to the webhost via a FTP client program. The problem here is that the App_Data folder is empty when i publish the website to my local folder. Could this be the problem?

Poku
  • 3,138
  • 10
  • 46
  • 64

2 Answers2

2

Check if your server allows to run user instances. If it allows then you need not do anything and just upload the MDF file to the App_Data folder on the server and you're good to go. You can also include App_data for publish which will automatically pick-up the App_Data folder along with the content.

If your server does not allow user instances then you need to perform following steps..

Ask admin to give you a SQLServer database along with access credentials.

From your Visual Studio right click on your database from the server explorer and select the option to PUBLISH TO PROVIDER. Follow the wizard steps and generate the SQL script with or without default data.

alt text http://ruchitsurati.net/myfiles/db.png

Connect to your Remote SQL Server from management studio and run the generated SQL script on the database given by your admin.

Update the connection string in your application for deployment.

this. __curious_geek
  • 42,787
  • 22
  • 113
  • 137
  • Does this fix my problem with the App_Data? Does it generate the sql for the tables that is in the App_Data or how does this fix the problem? – Poku Oct 15 '09 at 08:28
  • 1
    First thing I notice is that your connection string might not be correct as you are not able to connect to server at all. It says ' network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.' please check and let me know. – this. __curious_geek Oct 15 '09 at 09:06
  • im using the same connectionstring at the rest of the site without any problems. So i guess its not incorrect? – Poku Oct 15 '09 at 09:21
  • Is your User database for FormsAuthentication in different database ? – this. __curious_geek Oct 15 '09 at 09:23
1

Tick the "include files from the App_data folder" checkbox when publish.

alt text http://img260.imageshack.us/img260/8891/appdatapublish.png

dove
  • 20,469
  • 14
  • 82
  • 108
  • 1
    Thanks, this published my mdf file, but after uploading that file it still doesnt work. – Poku Oct 15 '09 at 08:29
  • @poku same error? details if not please. also check your connection string. could you provide details of this (password hidden obviously) – dove Oct 15 '09 at 09:09
  • 1
    yes, same error and the connectionstring is the same that im using on the rest of the site, which have no problems connecting to the database. – Poku Oct 15 '09 at 09:22