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
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configsections>


<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<appsettings>
<add key="ClientValidationEnabled" value="true">
<add key="UnobtrusiveJavaScriptEnabled" value="true">

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


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

<pages>
<namespaces>
<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">



<system.webserver>
<validation validateintegratedmodeconfiguration="false">
<modules runallmanagedmodulesforallrequests="true">

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




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


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



<connectionstrings>
<add name="EmployeeContext">
connectionString="server=.\SQLSERVER2008; database=Sample; integrated security=SSPI;"
providerName="System.Data.SqlClient"/>




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
Posted
Comments
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