c# - 如何解决 Azure "Windows logins are not supported in this version of SQL Server"?

标签 c# sql-server asp.net-mvc entity-framework azure-sql-database

当我尝试连接到 SQL Azure 时收到以下错误消息。

Windows logins are not supported in this version of SQL Server

我使用的是 Azure 连接字符串。在开发中,我正在针对 SQL Server Express 运行。当我尝试从数据库中获取一些数据时会抛出此特定错误。

我正在使用的上下文在 using 子句中运行,见下文

function List<SomeType> GetList(string dbContextName) 
{ 
    using (MyDbContext context = new MyDbContext) 
    {
         return context.SomeTypes.ToList();
    } 
}

我们使用 Entity Framework 4.2 版、ASP.NET MVC 3 和 .NET 4.0。

我该如何解决这个问题?

最佳答案

我正在使用 user/pass,但仍然收到错误消息。但是,我将它添加到我的连接字符串中并且它起作用了。

Trusted_Connection=False;Encrypt=True;

关于c# - 如何解决 Azure "Windows logins are not supported in this version of SQL Server"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9818354/

相关文章:

c# - 抛出System.OutOfMemoryException'-WebClient.DownloadStringAsynch()

sql-server - 在 PIVOT 查询中转换数据类型时出错

下拉菜单中的 PHP 存储和显示选项

c# - 基于当前登录的用户使用 LINQ 处理不同的数据库?

c# - ASP.net MVC,自定义部分 html 帮助程序,打开/关闭 div 不匹配

c# - 从 Windows 服务关闭显示

sql-server - SQL SSAS - 部署错误

javascript - 索引没有按预期出现在 url 中,因此 AJAX 调用转到错误的位置 - MVC 路由 AJAX

c# - 在不使用查询字符串的情况下在 ASP.NET MVC 应用程序中移动时如何保持 Sharepoint 上下文?

c# - 使用 C# 控制 cmd.exe(发送和读取输出)