leora
leora

Reputation: 196669

System.ArgumentException: Keyword not supported: 'provider'

I have a working copy of asp.net mvc site locally. I just uploaded the whole site to my web hosting server. everything looks fine at first but when i login, i get the following error:

System.ArgumentException: Keyword not supported: 'provider'.

[ArgumentException: Keyword not supported: 'provider'.]
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4907604
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
   System.Data.SqlClient.SqlConnection..ctor(String connectionString) +24
   System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +54

[ArgumentException: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString]
   System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +136
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +134
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
   SalemGolf.Controllers.AccountMembershipService.ValidateUser(String userName, String password) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:335
   SalemGolf.Controllers.AccountController.ValidateLogOn(String userName, String password) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:207
   SalemGolf.Controllers.AccountController.LogOn(String userName, String password, Boolean rememberMe, String returnUrl) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:59
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +245
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
   System.Web.Mvc.Controller.ExecuteCore() +123
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

any suggestions?

Upvotes: 14

Views: 51596

Answers (5)

questionto42
questionto42

Reputation: 9572

For those who run into this in SSIS instead:

If you make a connection manager in the Control Flow for an "Execute SQL Task" by choosing <New_connection...>:

enter image description here

You get a connection string with the "Provider" parameter on package level, for example with Provider=SQLNCLI11.1:

enter image description here

A connection manager that you made like this sometimes cannot be chosen inside a Data Flow Task without throwing an error. I write "sometimes" since I ran into this just this one time, and it worked again when I changed something that I cannot recall anymore, likely it needed a refresh or so. Proof by screenshots:

enter image description here

Throws the error:

enter image description here

Severity    Code    Description Project File    Line    Suppression State
Error       Validation error. my_DFT_name my_item_name  [148]: System.ArgumentException: Keyword not supported: 'provider'.
   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction)
   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper100 wrapper, Object transaction)      my_package.dtsx 0

If you make a connection manager on project level in the "Solution Explorer" pane, you get it without the "Provider" parameter:

enter image description here

It can be chosen inside the menu of DFT items without throwing the error:

enter image description here

No error:

enter image description here

PS

These thoughts also feed the answer at DFT drops connection and its temporary table after leaving any DFT item, tested with two Script Components. How do I keep the temp table alive? - DBA SE. I do not know whether this is linked.

Upvotes: 0

Ram Balwad
Ram Balwad

Reputation: 279

Also When your connection string parameter "User ID" use the space, if it is written as "UserID" then also it gives error

Upvotes: 4

vaibhav
vaibhav

Reputation: 31

Remove "Provider=MSDORA" from your connection string. And then this should work.

Upvotes: 3

Alexander Prokofyev
Alexander Prokofyev

Reputation: 34523

This MSDN article contains all allowed keyword values within the ConnectionString for SqlConnection object. "Provider" is not in the list.

You have two options:

  • remove "provider" keyword;
  • use an OleDbConnection instead of SqlConnection.

Upvotes: 9

Remus Rusanu
Remus Rusanu

Reputation: 294387

The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.

My suggestion is to fix the configuration string.

Upvotes: 14

Related Questions