Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SQL Express Connection String VS SQL Server Connection stringSQL Express Connection String VS SQL Server Connection string
Previous
 
Next
New Post
8/29/2006 12:18 PM
 

I recently switched to SQL Express from SQL Server 2005.  In SQL Server, I created a database in Mgmt Studio, then modified my connection string and ran.  Everything worked.  Now I want to use that same database with SQL Express.  What does the connection string look like, AND where do I put the MDF file?

Original connection string looks like this:

<!-- Connection String for SQL Server 2000/2005 -->

<add name="SiteSqlServer" connectionString="Server=(local);Database=dnn402;uid=dnn;pwd=dnn;" providerName="System.Data.SqlClient" /></connectionStrings>

 

<!-- Connection String for SQL Server 2000/2005 - kept for backwards compatability - legacy modules -->

<add key="SiteSqlServer" value="Server=(local);Database=dnn402;uid=dnn;pwd=dnn;" />

<add key="InstallTemplate" value="DotNetNuke.install.config" />

 
New Post
8/29/2006 12:38 PM
 

web.config:

<connectionStrings>
    <!-- Connection String for SQL Server 2005 Express -->

connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"
      providerName="System.Data.SqlClient" />

<connectionStrings>

I believe the .mdf file goes in your App_Code folder then reference that in the connstring.

 
New Post
8/31/2006 12:04 PM
 

Thanks Rugbymw.

I tried that string with the .mdf file in the app_data folder, and it didn't work.  I also tried putting the uid and pwd in the string in both places - still didn't work.

I'm guessing many people do or have done this and i just am not using the correct vocabulary to search for it.

 
New Post
8/31/2006 12:21 PM
 
OH, and I set the Server to "SQL Server and Windows Authentication Mode".
 
New Post
8/31/2006 8:14 PM
 

Now I seem to be able to run any databases I create in SQL Express, but I can't run the database I created in SQL Server 2005 Enterprise Edition.  Here's the error I get.

"ERROR: Could not connect to database specified in connectionString for SqlDataProviderSystem.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) ...  "

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SQL Express Connection String VS SQL Server Connection stringSQL Express Connection String VS SQL Server Connection string


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out