Keyword not supported: 'server'. Old ASP.NET webforms system

55 Views Asked by At

I have an old system using .NET 4.0, ASP.NET, Entity Framework, C# and SQL Server 2014.

I keep getting this error when trying to run the system, it used to work before!

Server Error in '/' Application.

Keyword not supported: 'server'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Stack Trace:

[ArgumentException: Keyword not supported: 'server'.]

System.Data.EntityClient.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Hashtable synonyms) +10219986
System.Data.EntityClient.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms) +114
System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +400
System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +56
Providers.ssirsMembershipProvider.GetFailedPasswordWindowForUser(String username) +111
_Default.Login2_LoginError(Object sender, EventArgs e) +119
System.Web.UI.WebControls.Login.OnLoginError(EventArgs e) +139
System.Web.UI.WebControls.Login.AttemptLogin() +11591419
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +111
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1890

It has something to do with my connection string in my web.config:

<connectionStrings>
    <add name="myConnectionString" 
         connectionString="server=svrDatabases;database=MyDatabase;uid=myuser;pwd=*****" 
         providerName="System.Data.SQLClient" />
    <add name="myEntities" 
         connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=svrDatabases;Initial Catalog=MyDatabase;Persist Security Info=True;User ID=myuser;Password=*****;MultipleActiveResultSets=True&quot;" 
         providerName="System.Data.EntityClient" />
</connectionStrings>

I have tried changing the providername to EntityClient, doesn't make any difference.

Banging my head against a wall.

Can someone help, please?

Thanks

1

There are 1 best solutions below

0
Lukasz Nowakowski On

SQL Server connection entry should look like this (when using SQL Server authentication):

<add name="CONNECTION_NAME" 
     connectionString="data source=SERVER_NAME;Initial Catalog=DATABASE_NAME;User Id=USER_NAME;Password=PASSWORD" 
     providerName="System.Data.SqlClient" />

For more options check https://www.connectionstrings.com/sql-server/