Google Analytics İzleme

09 Eylül 2010

The connection name 'LocalSqlServer' was not found in the applications configuration hatası ve çözümü

The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 148) Hatası oluşuyorsa:

Çözüm:


Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty

If you receive the following application error message from your web application:

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

The solution is to modify your application's web.config file and add the following line to the connection string element:

<connectionStrings> 
<remove name="LocalSqlServer" /> 
<add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />  
</connectionStrings> 

Kaynak:

https://support.winhost.com/KB/a813/parser-error-message-connection-name-localsqlserver.aspx

-------------------------------------------------


Resolution

The above error message indicates that connection string names LocalSqlServer is being used in the machine.config file. You have to override this setting to point to your connection string name which is used in the application’s web.config file.

This can be done by clearing, removing and adding connection string name in your web.config file as shown below.

<connectionStrings>
<clear />
<remove name=”LocalSqlServer ” />
<add name=”LocalSqlServer” connectionString=”Server=SQL_SERVER_HOST; User ID=YOUR_USER_NAME;password=YOUR_PASSWORD;Database=YOUR_DATABASE_NAME;Persist Security Info=False” providerName=”System.Data.SqlClient” />
<add name=”ASPNETDBConnectionString” connectionString=”Server=SQL_SERVER_HOST; User ID=YOUR_USER_NAME;password=YOUR_PASSWORD;Database=YOUR_DATABASE_NAME;Persist Security Info=False” providerName=”System.Data.SqlClient” />
</connectionStrings>

Add the above code to your web.config file, update the variables mentioned in capital letters and upload to your web server. Your application should work fine now.

Kaynak:

http://www.learnxpress.com/fix-the-connection-name-localsqlserver-was-not-found-in-the-applications-configuration-or-the-connection-string-is-empty.html






Hiç yorum yok: