netghost
  • Posts: 51
  • Joined: 30/09/2011
<connectionStrings>
<add name="holder" connectionString="Data Source=(local);Initial Catalog=database_;User ID=database_user;Password=database_password"/>
</connectionStrings>


i get the following error whenever i use the connection string above ...i am trying to install the new yaf



Failed to connect:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

i am hosting my site with mochahost
Sponsor
squirrel
  • Posts: 925
  • Joined: 14/01/2010
In yaf's main web.config, you have to specify which 'connection' you are using in db.config.

So if your connection name is "holder" as shown above, then in the web.config, you have to find all instances of the original YAF connection Name and update those to match your name used in db.config.

Additionally, if you are sending username and password, you sometimes have to tell the SQL connection that it is not a Trusted Connection - trusted connections use Windows Authentication to connect to the database, which won't work in this context because the 'windows user' running the site will most likely not be the windows user operating the database.
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
Chetan Bavarva
  • Posts: 19
  • Joined: 17/11/2016
If you have the *.mdf placed in App_Data folder, using this format works:


<connectionStrings>
  <add name="ConnectionName"  connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|DatabaseName.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
</connectionStrings>

Chetan Patel
Custom software company India 
iFour Technolab Pvt. Ltd
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved