zoukankan      html  css  js  c++  java
  • EF之数据库连接问题The specified named connection is either not found in the configuration, not intended to be used with the Ent

    Entity Framework项目自动生成的edmx文件的连接字符串的问题

    1.首先修改<add name="NorthWindEntities"        connectionString="metadata=res://*/NorthWind.csdl|res://*/NorthWind.ssdl|res://*/NorthWind.msl;provider=System.Data.SqlClient;provider connection string=&quot;    fData Source=127.0.0.1;Initial Catalog=NorthWind;Persist Security Info=True;User ID=sa;Password=123456;MultipleActiveResultSets=True&quot;"  providerName="System.Data.EntityClient" />

    2.若是出现以下异常则说明执行程序所在的项目没有引用到该连接字符串

    The specified named connection is either not found in the configuration, not intended to be used with the EntityClient Provider, not valid.

    一般是连接字符串所在的App.Config的问题,他必须出现在执行程序所在的那个Web.Config 或者是 App.Config

    参考:MSDN

  • 相关阅读:
    C# Nugut CsvHelper 使用
    C# 读写txt
    Js打开QQ聊天对话窗口
    Js 读写Cookies
    js 计算时间差
    C# 读取CSV文件
    使用 SqlBulkCopy 批量插入数据
    sql 添加列并设置默认值
    C# 获取Enum 描述和值集合
    SQL连接其它服务器操作
  • 原文地址:https://www.cnblogs.com/senion/p/2020379.html
Copyright © 2011-2022 走看看