如何启用MultipleActiveResultSets [英] How to enable MultipleActiveResultSets

查看:173
本文介绍了如何启用MultipleActiveResultSets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码中包含以下连接字符串:

I have the following connection string in my code:

SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["RaiseFantasyLeagueConnectionString"].ConnectionString);

为此,我的webconfig如下:

My webconfig for this looks like this:

    <connectionStrings>
<add name="RaiseFantasyLeagueConnectionString" connectionString="Data Source=MATT-PC\SQLEXPRESS;Initial Catalog=Raise;Integrated Security=True" providerName="System.Data.SqlClient"/>

有人可以告诉我在哪里可以为我的连接启用MultipleActiveResultSet吗?

Can somebody tell me where I can enable MultipleActiveResultSets for my connection?

推荐答案

这很简单,只需添加

MultipleActiveResultSets=true;

以这种方式在您的web.config中更改连接字符串:

so change, in your web.config, the connection string in this way:

connectionString="Data Source=MATT-PC\SQLEXPRESS;" + 
                 "Initial Catalog=Raise;Integrated Security=True;" + 
                 "MultipleActiveResultSets=true;" 

这篇关于如何启用MultipleActiveResultSets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆