当我尝试连接到 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/