Click here to Skip to main content
15,905,238 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my web.config.It dose not work

For more information on how to configure your ASP.NET application, please visit

<!-- For more information on Entity Framework configuration, visit -->
<add key="ClientValidationEnabled" value="true">
<add key="UnobtrusiveJavaScriptEnabled" value="true">

<trace enabled="true" pageoutput="false"> <compilation debug="true" targetframework="4.0">
<add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Web.Helpers, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Web.WebPages, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />

<add namespace="System.Web.Helpers">
<add namespace="System.Web.Mvc">
<add namespace="System.Web.Mvc.Ajax">
<add namespace="System.Web.Mvc.Html">
<add namespace="System.Web.Routing">
<add namespace="System.Web.WebPages">

<validation validateintegratedmodeconfiguration="false">
<modules runallmanagedmodulesforallrequests="true">

<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyidentity name="System.Web.Mvc" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="" newversion="">

<defaultconnectionfactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameter value="Data Source=.\SQLSERVER2008; Integrated Security=True; MultipleActiveResultSets=True">

<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer">

<add name="EmployeeContext">
connectionString="server=.\SQLSERVER2008; database=Sample; integrated security=SSPI;"

Model Part

public class EmployeeContext :DbContext
public DbSet<employee> employees { get; set;}

Error Message

An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.

Please Help me
TryAndSucceed 16-Dec-13 13:30pm    
I dont see using UserId and Pwd in connection string. You didn't add it here purposely or you dont have it at all.
Code.Combustion 16-Dec-13 14:07pm    
Please re-paste your config file and ensure the < tags > are not stripped. It looks like sections have been removed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900