Please help: steps to go from SQL Express and SQL 2005 Production

G

Guest

Not sure if I should post this here or SQL so here goes...


I really need some advice regarding how to handle ASP.NET 2.0 development
and SQL MSDE and 2005 Server. Maybe I am just making this more difficult
then it is - please let me know.



Background
------------------
I am using the VS 2005's ASP.NET 2.0's Personal Website Starter Kit as a
simple example.

The template automatically creates two local MDF files ("ASPNETDB.mdf" for
the membership and roles, and "PERSONAL.mdf" for the site itself) THAT GETS
LOADED from the websites local app_data directory when the site itself is
loaded. that is, the MDF files are not attached to the SQL database.


GOAL
--------
My SQL Host ISP only has one database and I want to consolidate all the
tables into one attached database. So I only want one MDF file called
"MYDB.MDF" that is ATTACHED to my local development SQL server (MSDE). I will
import all the objects from the other MDF files to single MDF


Problems
---------------


To migrate the existing project with two databases:

(PROBLEM 1) I assume I only need import ASPNETDB and PERSONAL into MYDB.
BUT, when i did this through import/export all the VIEWS got copied under
Tables too, not under views???

(PROBLEM 2) But what do I have to change in the ASP.NET web config
ConnectionString settings beside the DSN name?

<connectionStrings>
<add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User
Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf"
providerName="System.Data.SqlClient"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data
Source=.\SQLExpress;Integrated Security=True;User
Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf"/>
</connectionStrings>



(3) when I am updating production for later revisions I will need to import
production data back into my test database to make it current and so on...

Am I making this more difficult then it is? Is there an easy way to go back
and forth from sql express and sql server?
 
G

Guest

Peter ,

Thanks for the help. Great site.

BTW, I tweaked your idea to change the web.config for my app versus
machine.config which I won't have control over.

What bothers me about changing the web.config is every time I republish my
site, it will overwrite the web.config and I'll have to re-edit it. Is there
an alternative way?
 
G

Guest

Of course, yes you would want to do it in web.config.

you can use an <appSettings file="pathToExternalFile" >
element so that appSettings don't get disturbed. I'm not sure
if this can be done for other sections, but it should be a start.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top