Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2006, 02:45 PM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual Studio 2005 App_Data DB to SQL


Hello .NET experts !

Is there a proper way to move a DB created in Visual Studio 2005 App_Data Database.mdf , over to a SQL Server Machine and attach it ?

Thank you so very much !
Chuck

 
Old August 26th, 2006, 02:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Chuck,

If you mean "SQL Server 2005" with "SQL Server Machine", then yes. You can simply copy the .mdf file to another machine and attach them there using SQL Server Management Studio.

If you mean "SQL Server 2000", then no, this is not possible. The formats are not compatible. You can create scripts for all the objects in the 2005 database, remove all 2005 specific features and run the script against the 2000 installation.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 28th, 2006, 09:27 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Imar,
Thanks for your help. Oh boy, not compatible... that's really a shame, guess I'll have to upgrade eventually.
I'm on SQL 2000, and was unable to open the .mdf in EM. Thanks for your answer.

When I move my local host project with App_Data DB to the webserver, my pages cant find the App_Data DB.
What is the proper path to the App_Data folder, once it is uploaded to the webserver ?
Thanks Imar !

Chuck._aa

 
Old August 28th, 2006, 02:25 PM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One more question, does SQL Express 2005 have to be installed on the webserver too ?

 
Old August 28th, 2006, 05:00 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

.NET allows you to use something like this in your connection string:

|DataDirectory|WebShop.mdf

At run-time, this expands to App_Data folder of your site. Where exactly this is, depends on your ISP. If you need the physical path to the folder, you need to ask them, or diagnose the Request object and write out its properties, like Request.PhysicalApplicationPath

And if you want to use SQL Server 2005, you need it on the server somehow (or on a different machine accessible by the server), whether it's the free Express Edition or one of the commercial versions.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 30th, 2006, 07:10 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SqlExpress does not have to be on the webserver itself but it does have to be on a machine accessible by the webserver if you want ot use it.







Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL 2005 Express DBs in MSE or App_Data/db Explore cJeffreywang SQL Server ASP 0 February 13th, 2008 10:32 PM
installing sql server 2005 with visual studio lucycastaldo SQL Server 2005 2 April 23rd, 2007 06:46 PM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Visual Studio 2003 vs. Visual Studio 2005 eitanbarazani C# 2005 4 May 9th, 2006 01:34 AM
Visual Studio .net2003 and Visual Studio 2005 Gert Visual C++ 1 January 24th, 2006 05:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.