Solution 1:

The string you passed is not a valid database connection string, it's an EF connection string that contains a SQL Server connection string in its provider connection string parameter. WebSecurity.InitializeDatabaseConnection expects a valid database connection string

To avoid parsing the connection string yourself, you can use the EntityConnectionStringBuilder class to parse the string and retrieve the database connection string from its ProviderConnectionString property

Solution 2:

When this happened to me it was because the connection string had:

providerName="System.Data.SqlClient"

but it should be:

providerName="System.Data.EntityClient"

because as was said by the other answer, it is an EF connection string.