Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is emptyIf 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:
C#, .NET, .Net Core
ASP.NET MVC, ASP.NET Web Forms, ASP.NET Core
HTML 5, CSS 3, Javascript, jQuery, Bootstrap
Entity Framework, NHibernate, Dapper
Sql Server, MySql, Oracle
Windows Server, Ubuntu, Debian, Pardus
Xamarin Forms, Android Studio
--- The future of the open web platform is looking very bright!
--- .NET is a free, cross-platform, open source developer platform for building any app.
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:
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder