[英]EF Code First Connecting to SQL Server 2008 R2
我正在努力找到解決我正在連接到在家庭網絡上運行的SQL Server的問題的解決方案。 它通常工作正常,我有其他項目使用EF,我正在使用EDMX模型正常工作。 SQL身份驗證詳細信息我正常工作以連接到服務器。
我在App.Config文件中使用以下連接字符串: -
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<connectionStrings>
<add name="Entities"
providerName="System.Data.SqlClient"
connectionString="Server=192.168.1.4\SQLDEV01;Database=TestLab;user id=Kaiser;password=mud.sit.map-651;Integrated Security=True;" />
</connectionStrings>
</configuration>
拋出的異常是: -
{“提供程序未返回ProviderManifestToken字符串。”}
而它的內在異常>
登錄失敗。 登錄來自不受信任的域,不能與Windows身份驗證一起使用。
當您指定Trusted_Connection=true
,您正在使用Windows身份驗證,因此它嘗試使用附加到您正在運行的任何類型的應用程序的線程的標識進行登錄。
如果您使用的是sql身份驗證,請從連接字符串中刪除Trusted_Connection
屬性。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.