Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Tuesday, March 27, 2012

copying website: database doesnt work?

Since VWD Express doesn't support Publish Website, I used 'Copy Website' to deploy my local site to the hosting server. The static page works fine, but when it gets to accessing database, I kept getting the following error:

An attempt to attach an auto-named database for file I:\Data\Web\dnh.sk\lingling_15726c71-b2bf-479f-bcc3-b7ae43318f3c\www\App_Data\Personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Anyone has the same experience? How to resolve this?

Thanks,

When you deploy your project, you have to upload your database separately.

You cannot use the db from the app_data folder. Execute the SQL against the db that you have in your hosting server and change the connectionstring for that.

Regards

|||

smiling4ever wrote:

When you deploy your project, you have to upload your database separately.

You cannot use the db from the app_data folder. Execute the SQL against the db that you have in your hosting server and change the connectionstring for that.

How do you do this when you only have VS.2005 and the basic SQL Express tools? Is it possible?

Tuesday, March 20, 2012

Copying SQL Server website to CD

Hi!

Not sure if this is the right place to post. I need to copy a website that I created on a CD. It is using SQL Server as the database and VB, ASP as front end. However, the problem is that I need to copy it in such a way so that it can be viewed from the CD itseld without needing MSDE or SQL Server. Need help.

Thanks.

This is a fine place to post.
The problem here is that it is difficult to make a SQL Server databaseread-only, which it needs to be on a CD. I realize that you probablywant to use the same db as you use on a Web site, but it's a hassle.
That said, there are a few options. Check out the sp_create_removablesystem stored procedure, which lets you create a removable mediadatabase. It's a bit tricky to get to work right, but ask questionshere if you want to use that option. I think I have some sample codelaying around.
But wait...you don't want SQL Server or MSDE installed at all? Ifthat's what you mean, you're out of luck. You're going to have to useanother way to store and use the data on the CD. An XML file mightwork. You could maybe use another database engine, such as Access, butit's going to have to be installed on the machine. (Anyone know if theAccess runtime is still available? I'm not an Access guy.)
Please clarify what you want to do and we'll try to help.
Don
|||

Thanks for replying.

ACtually I just realized that if there is a way to get the MSDE on the CD itself and make it work that is fine. SO if that is the case then we would not need Access on the user machine and the user would not have to install the MSDE. You think this would work? How ?

Thanks again.

|||I'm confused. What do you mean that you can get MSDE on the CD? MSDE has to beinstalled on the computer in order to access the database. You can't just put a program on a CD and not have to install anything.
So no, it won't work. (Unless there is something I don't know about MSDE, which is quite possible!)
Don

Friday, February 24, 2012

'Copy Website' function in VS 2005 updates or overwrites Database?

I have a sql 2005 express database uploaded to my website with important information in it.

Now, I had to make some table change and need to update the online database.

I am not sure if the 'Copy Website' function in Visual Studio 2005 will update the database structure and data or will simply overwrite it.

Does anybody know the answer? If it overwrites it, would you please point me to information on how can I update the database structure and data without ruining it?

Thanks.

The system will over right as the moderfications will have been done in the local copy of the database... ie in the APP_Data.. (I am thinking that this is your case). If you only wanted to change the database schema and such one way would have been to create a database project and script out the changes as you were making them. Then you could have run the script against the old database.

Going forward you might have to copy down the database from the production system... Copy your web site project to the production system then import the old data into the new database structure on the server. Or you might be able to find some scripts to compare the databases and generate the scripts required to make the change in the production system.

|||Thanks Glenn!