- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想了解 Multiple Active Result Sets 我已经阅读了 Microsoft 文档,但是如果您可以添加一些有关 MultipleActiveResultSets 的示例,我不是很了解。
When MARS is enabled for use with SQL Server, each command object usedadds a session to the connection. I didn't understand it.
一般来说,什么时候应该在连接字符串中使用“MultipleActiveResultSets”?
例如,我已将这段代码用于迁移数据库,但出现了一些错误。
Keyword not supported: "MultipleActiveResultSets"
public static void Main(string[] args)
{
var host = CreateHostBuilder(args).Build();
using(var scope = host.Services.CreateScope())
{
var services = scope.ServiceProvider;
try
{
var context = services.GetRequiredService<DataContext>();
context.Database.Migrate();
}
catch (Exception ex)
{
var logger = services.GetRequiredService<ILogger<Program>>();
logger.LogError(ex, "An error occured during migration.");
}
}
host.Run();
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings":{
"DBConnection": "server=.;database=ReactivityDB;MultipleActiveResultSet=true;Trusted_Connection=True"
}
最佳答案
根据您的错误信息:
Keyword not supported: 'multipleactiveresultset'
和你的连接字符串:
...database=ReactivityDB;MultipleActiveResultSet=true...
该关键字应为复数形式:
...database=ReactivityDB;MultipleActiveResultSets=true...
关于c# - 连接字符串中的 MultipleActiveResultSets 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58769812/
我启用了 MARS 但仍然无法在一个连接中执行两个 SqlDataReader,我搜索了一个解决方案以使用 RegEdit 默认启用 MARS 找不到任何解决方案并且仍然收到该错误:已经有一个与此命令
我的代码中有以下连接字符串: SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["Rai
我想了解 Multiple Active Result Sets 我已经阅读了 Microsoft 文档,但是如果您可以添加一些有关 MultipleActiveResultSets 的示例,我不是很
我的 Linq to Entities 查询是这样的: ForEach(something) { var query = (some DB query).ToList(); for eac
我有一个包含订阅者的表。每个订阅者都从某个日期开始关注 Targets。有关目标的新信息正在名为 TargetDatas 的表中累积。 我想创建一个需要获取报告的订阅者列表,其中包含自上次报告以来目标
我有一些 C#,我在其中创建连接上的读取器 (ExecuteReader),然后针对该读取器中的每一行执行另一个命令(使用 ExecuteNonQuery)。在这种情况下,我在连接上使用 Multip
首先,我花了几个小时寻找解决方案 - 也许我只是需要另一双眼睛来解决这个问题。 我目前正在为自己编写一个 c# 应用程序(个人使用)。我正在运行来自 mysql.com 的最新 MySQL 连接器库
所以我有一个类似于以下内容的类。有一个线程使用 Entity Framework Code First DbContext 做一些工作。 我遇到的问题是 m_DB 上下文似乎正在缓存数据,即使它应该为
谁能告诉我是否可以在 sql server localdb 上启用 MultipleActiveResultSets = True 命令。 我在使用相同方法打开 DataReader 时遇到问题,甚至
在本地开发时,我有一个连接字符串集,其 MultipleActiveResultSets 设置为 TRUE。但是,当我部署我的应用程序并注入(inject) sequelizer connection
我有以下使用 Dapper.SimpleCRUD 的代码: var test = new FallEnvironmentalCondition[] { new FallEnvironmenta
我有一个使用 EF Core 的 ASP.Net Core 应用程序。 我使用 ASP.Net Identity 并为我的应用程序的实体共享相同的 DBContext。 我已将 Azure SQL 数
我正在使用 visual studio、postgresql 数据库和 ado.net 实体数据模型。在连接字符串中,我无法设置 MultipleActiveResultSets=True。 通常当我
我编写的大多数应用程序不使用 MultipleActiveResultSets=True ,但我已经看到在其中几个和一些教程中启用了该选项。 这个 SO question 处理相同的主题,但它很旧,我
我们在云上部署的应用程序版本面临一些问题。 我们的应用程序是一个带有 ADO .NET Entity Framework 的 ASP.NET MVC 3 项目。 根据 msdn 博客,我们需要在数据库
我是一名优秀的程序员,十分优秀!