Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SimpleMembershipProvider WebSecurity.InitializeDatabaseConnection failing with an empty sql database

I just added a sqlserver connection string. fresh new database. I checked the connection is fine on server explorer.

<add name ="club" connectionString="Data Source=server1;Initial Catalog=temp;Integrated Security=True"/>

Then referenced it in InitializeSimpleMembershipAttribute as follows

WebSecurity.InitializeDatabaseConnection("club", "Users", "UserID", "UserName", autoCreateTables: true);

It works in a sdf file and creates the tables. But fails with sql server. Anyone seen this error before and can explain what is happening?

Error -

Keyword not supported: 'initial catalog'. Exception Details: System.ArgumentException: Keyword not supported: 'initial catalog'.

like image 773
MoXplod Avatar asked Dec 11 '22 21:12

MoXplod


1 Answers

Add providerName="System.Data.SqlClient" to your connection string.

<add name="club" 
  connectionString="Data Source=server1;Initial Catalog=temp;Integrated Security=True"
  providerName="System.Data.SqlClient"/>
like image 143
Erik Funkenbusch Avatar answered Dec 14 '22 12:12

Erik Funkenbusch