Back to list
Views:   9K
Replies:  1

Attaching SQL Server in Design Pattern Framework

I attached both the ASPNETDB.mdf and Action.mdf to my local SQLServer instance and modified the Web.config for Host.WCF.ActionServer and App.Config for DataObjects\App.Config but I get this error when I click on Products link:

+  $exception {"The underlying provider failed on Open."} System.Exception {System.Data.EntityException}

Is there anywhere else I need to change the connection string?

Sunit Joshi, Aug 05, 2010
Reply 1
Hi Sunit: 

The problem is your connectionstring to the ASPNETDB.sql.   Membership uses an implicit connectionstring (to ASPNETDB.SQL under \App-Data). So, by moving this database to SQL Server you also need to adjust this under the Membership section in web.config. 

I suggest that you not directly attach the local SQL Express databases to SQL Server, but instead do it in the following 2 steps (that is, one database at a time).

STEP 1) Migrating the Action database.

1) Create a brand new database on SQL Server, called Action.
2) Run Action.sql script to create the tables and the data (this file is under Solution Items\Sql Server\Action.sql)
3) Adjust the entries in web.config (according to the documentation. Note: the connectionstrings are already in place)

Then run.

At this point you are still using the local ASPNETDB.sql membership database.

STEP 2)  You can also migrate the ASPNETDB database like so: 

1) Create a brand new database on SQL Server, called ASPNETDB
2) Run Aspnetdb.slq script which creates the membership schema and user entries.
3) Adjust the Membership section in web.config (here is an example of how to do this:

Then run.

Hopefully, this gets you going.
Dan McMillan, Aug 05, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.