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

  • 相关阅读:
    STM32寄存器的简介、地址查找,与直接操作寄存器
    SPI初始化寄存器配置
    docker 命令
    SpringBoot接口格式和规范
    算法
    RabbitMQ
    UML概念
    activeMQ和JMS
    设计模式七大原则
    redis缓存
  • 原文地址:https://www.cnblogs.com/ymh2013/p/3565349.html
Copyright © 2011-2022 走看看