zoukankan      html  css  js  c++  java
  • EF数据库配置

    1 <?xml version="1.0" encoding="utf-8"?>
     2 <configuration>
     3     <configSections>
     4         <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
     5         <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     6     </configSections>
     7     <entityFramework>
     8         <providers>
     9             <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    10         </providers>
    11     </entityFramework>
    12     <connectionStrings>
    13         <add name="BlogContext"
    14               providerName="System.Data.SqlClient"
    15               connectionString="Server=xxx;Database=xxx;Integrated Security=False;User ID=sa;Password=xxx;"/>
    16     </connectionStrings>
    17 </configuration>

    配置的数据库连接字符串配置项的name应该与你的Context类型的名称一致,例如本例中就应该配置为BlogContext

  • 相关阅读:
    无题..
    让Windows 2003 Server支持ASP程序
    下雪
    比较经典的.NET基础
    XML几种操作
    某年某月有几天
    .NET操作Word(傻瓜型)
    XML 简单操作
    一首歌
    ASP.NET:掌握Web窗体的生命周期与状态管理(摘自网络)
  • 原文地址:https://www.cnblogs.com/ymh2013/p/3565349.html
Copyright © 2011-2022 走看看