Print Page | Close Window

Relocate ASP.NET mbr db from SQL Svr Express to my db

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2267
Printed Date: 21-Jan-2026 at 11:34am


Topic: Relocate ASP.NET mbr db from SQL Svr Express to my db
Posted By: rowek
Subject: Relocate ASP.NET mbr db from SQL Svr Express to my db
Date Posted: 27-Oct-2010 at 8:29am
I really like DevForce v6.0.6.0, particularly the addition of the "DevForce SilverLight Business Application" template.   I am using the "Windows 7 Theme".   The good news this is a fresh, Proof of Concept app that only has one table in an existing database.   I read the docs and it indicated the ASP.NET Membership stuff will be hosted in SQLServer Express.   I don't want to do that.   I want all that good stuff in my existing db.   I also plan to add many more small tables to this db, but share the same ASP.NET Membership stuff.   What is my best approach?  Shall I run the command to create ASP.NET Membership stuff in my existing db then tell DevForce to use those resources (tables, views, SPROCs, etc.) instead?
 
I will gladly read any docs you can point me to.



Replies:
Posted By: rowek
Date Posted: 27-Oct-2010 at 9:00am
Hi, after more digging I found a great post under "Getting Started" called "New Silverlight "Business Application" templates shipped with v6.0.6 ". 
 
I ran the Aspnet_regsql.exe wizard the the required objects were quickly built in my db.    My last issue is simple:  How do I tell DevForce to use my db instead of SQL Server Express?  I have read everything I can find and cannot find an entry in the web.config file.
 
Many thanks!


Posted By: kimj
Date Posted: 27-Oct-2010 at 9:29am

The post you referenced also mentions how to re-point the connection string.  By default, ASP.NET has defined a connection string named "LocalSqlServer" in your machine.config, so in your web.config you must first remove the existing one, and then add your own.  Something like this:

<connectionStrings>
          <remove name="LocalSqlServer" />
          <add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;Initial Catalog=aspnetdb;" providerName="System.Data.SqlClient"/>
       </connectionStrings>
 
You'll probably need to change the data source and Initial Catalog, and add a user id and password if using SQL security.
 
If the connectionStrings element isn't in your web.config yet, add it anywhere after any configSections defintions. 


Posted By: rowek
Date Posted: 27-Oct-2010 at 12:04pm
That did the trick. Thank you very much.



Print Page | Close Window