SimpleMembershipProvider WebSecurity.InitializeDatabaseConnection does not work with an empty sql database

I just added sqlserver connection string. new new database. I checked the connection perfectly on the server explorer.

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

Then name it in InitializeSimpleMembershipAttribute as follows

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

It works in an sdf file and creates tables. But crash with sql server. Has anyone seen this error before and can explain what is happening?

Error -

Keyword not supported: "start directory". Exception Details: System.ArgumentException: Keyword Not Supported: "Start Directory".

+4
source share
1 answer

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

 <add name="club" connectionString="Data Source=server1;Initial Catalog=temp;Integrated Security=True" providerName="System.Data.SqlClient"/> 
+13
source

Source: https://habr.com/ru/post/1439264/


All Articles