Thursday 6 October 2016

Keyword not supported: initial catalog

Introduction

In this In this article I will explain cause and resolution of Keyword not supported: initial catalog error

Cause

This error occurs when we are implement asp.net membership and error occurs in Global.asax file at the following line:
   WebSecurity.InitializeDatabaseConnection("Action", "Member", "MemberId", "Email", autoCreateTables:= True)
This error occurs when we have not specified provider name in connectionString.

Resolution

To resolve this error you need check your connectionString and add providername property in your connectionString.

Suppose you are trying to connect with Sql Server so you have to add providerName="System.Data.SqlClient"

Example

     <connectionStrings>
   <add name="con" connectionString="Data Source=ServerName;Initial Catalog=master;Integrated Security=SSPI;" providerName="System.Data.SqlClient"></add>
  </connectionStrings>

No comments :

Post a Comment