title: What does MultipleActiveResultSets in connection string?
body: <p>I would like to know about Multiple Active Result Sets I have read Microsoft documentation, but I didn't understand it very well if you can add some example about MultipleActiveResultSets.</p>
  <blockquote>
  <p>When MARS is enabled for use with SQL Server, each command object used
  adds a session to the connection. I didn't understand it.</p>
  </blockquote>
  <p>In general, When should I use &quot;MultipleActiveResultSets&quot; in the connection string?</p>
  <p>For instance, I have used this code for the Migrating database, but I got me some error.</p>
  <blockquote>
  <p>Keyword not supported: &quot;MultipleActiveResultSets&quot;</p>
  </blockquote>
  <pre><code>  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&lt;DataContext&gt;();
                      context.Database.Migrate();
                  }
                  catch (Exception ex)
                  {
                      var logger = services.GetRequiredService&lt;ILogger&lt;Program&gt;&gt;();
                      logger.LogError(ex, &quot;An error occured during migration.&quot;);
                      
                  }
              }
              host.Run();
          }
  </code></pre>
  <hr />
  <pre><code>{
    &quot;Logging&quot;: {
      &quot;LogLevel&quot;: {
        &quot;Default&quot;: &quot;Information&quot;,
        &quot;Microsoft&quot;: &quot;Warning&quot;,
        &quot;Microsoft.Hosting.Lifetime&quot;: &quot;Information&quot;
      }
    },
    &quot;AllowedHosts&quot;: &quot;*&quot;,
    &quot;ConnectionStrings&quot;:{
        &quot;DBConnection&quot;: &quot;server=.;database=ReactivityDB;MultipleActiveResultSet=true;Trusted_Connection=True&quot;
    }
      
  </code></pre>
  <p>}</p>