Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I was trying to upload the database of my ASP.NET website. On the local machine, if I copy the database from another machine, I have to attach it through SQL Server Management Studio and then use it in the connection string like

My database is approx. 10 MB in size for now. If I upload it via ftp to App_Data folder, how would I have to attach this database?

In Plesk, I have the option to create the database and its user (as shown in the screenshots):

1) Web Applications and services-Plesk
![alt text][1][^]

2) Add New Database
![alt text][2][^]
and add new database user

3) Webadmin>ASP.ET Enterprise Manager
![alt text][3][^]

But this is for the new database I created. My problem is to upload an existing one.

There's also a section in Plesk for ASP.NET settings (as shown below)
![alt text][4][^]
This has the option to change the connection string etc.

I also asked my hosting provider about the method to be followed for attaching the database that I would upload. This was the reply in quote.

mdf ldf files perhaps will be working at your local computer but this way database of mssql will not work on web server as on web server you will be required to create and restore your database backup file using plesk control panel.

Sample connection string for mssql `Standard Security`:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=

Server name to be used in coding: localhost
Catalog/ database name , database user and database password
you will be required to create your own using plesk control panel

I would be really be appreciative for the steps I have to take to upload my existing database. How do I have attach it? What connection string I have to use?

1 solution

They are telling you that you don't upload it: you use the plesk control panel to create a database (presumably they have provided an interface for you to do this). You would then run in any scripts and populate any reference/test data as required. It may be that once the database is created you can use SQL Management Studio to connect to and administer the database. Reread the instructions they have provided and take a look at any FAQs they provide - it is almost impossible that anyone here would know the exact steps you need to take for an unknown web host.
Share this answer
optimus_prime1 14-Jan-11 7:00am    
Yes, I have an interface to create the database i.e the ASP.NET Enterprise Manager but I havem't been able to figure out where to install the .sql scripts in there. Actually, there's a small icon named 'query'. Is that to be used for the SQL Script? Here's the screenshot of the interface I have for creating the database.
R. Giskard Reventlov 14-Jan-11 7:04am    
If they do not provide a mechanism for accessing the database once it has been created it means that you must do so. If you have it, use SQL Management Studio or similar and connect using the connection string they provide. I don't have access to images. READ THE F****** MANUAL: in other words, they must have many customers who figure this out and I'm sure they have not gone out of their way to make it as awkward as possible for you so why not just ask them - they should be happy to help you.

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