Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 15, 2012 01:43 AM by tdykstra
Nov 14, 2012 07:50 PM|LINK
My connection string is:
Source=GEMSFAMILY\GEMSFAMILY;Initial Catalog=My-MSI.Net;User ID=userid;Password=password;providerName=System.Data.EntityClient"
needs to be done with this to get things working? Oh, by the way, I know that the userid and password are correct but that is not what is in the above statement.
Nov 14, 2012 07:59 PM|LINK
Unless you're using the EF Designer, you need System.Data.SqlClient instead of EntityClient (assuming you're using SQL Server). If you are using the Designer, the format of the string is very different and should have been generated by the designer. See
Nov 14, 2012 08:06 PM|LINK
Well with this connection string it still didn't work:
Source=GEMSFAMILY\GEMSFAMILY;Initial Catalog=My-MSI.Net;User ID=userid;Password=password;providerName=System.Data.SqlClient"
Nov 14, 2012 08:09 PM|LINK
What is the error you're getting? Also, for SQL Server you generally need to add ";MultipleActiveResultSets=true" to the end of the string.
Nov 14, 2012 11:31 PM|LINK
The error I'm getting is the subject line in this message thread:
The connection string 'EFDbContext' in the application's configuration file does not contain the required providerName attribute."
The connection string is:
Source=GEMSFAMILY\GEMSFAMILY;Initial Catalog=My-MSI.Net;Persist Security Info=True;User ID=userid;Password=password;ProviderName=System.Data.SqlClient;MultipleActiveDataSets=true"
Nov 14, 2012 11:56 PM|LINK
Which development approach are you using -- code first, database first, or model first? If it's one of the latter two you need to use a connection string that the designer generates and which looks something like this:
<add name="ConnectionStringName" providerName="System.Data.EntityClient" connectionString="metadata=res://*/ ContextClass.csdl|res://*/ ContextClass.ssdl|res://*/ ContextClass.msl;provider=System.Data.SqlClient;provider connection string="Data
Source=ServerName;Integrated Security=False;User Id=userid;Password=password;MultipleActiveResultSets=True"" />
Nov 15, 2012 12:26 AM|LINK
I prefer to build the database first and then connect to it with the web project (MVC 3).
When I tried placing quotes around the providerName value, I get syntax errors in the connection string.
Nov 15, 2012 01:43 AM|LINK
In the Web.config file, the provider name is not part of the connection string. If you're not using the designer (if you don't have an .edmx file), the connection string should look like this:
<add name="ConnectionStringName" providerName="System.Data.SqlClient" connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid;Password=password;MultipleActiveResultSets=True" />