Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql connector - MultipleActiveResultSets issue

First off, I have spent hours looking for a fix - maybe I just need another pair of eyes on this problem.

I'm currently coding a c# application for myself(Personal use). Im running the latest MySQL connector library from mysql.com

My connection string is

public string SQLConnection = "Server=localhost;Database=data;Uid=root;Pwd=ascent;charset=utf8;MultipleActiveResultSets=True;";

My issue is regarding MultipleActiveResultSets=True; . When this is included in my SQLConnection string the MySQL library is unable to connect. View the pic below to view my findings

full image: http://i62.tinypic.com/25a57p1.png

When MultipleActiveResultSets=True; is removed from the connection string, I get this result

full image: http://i58.tinypic.com/2useaom.png

I get a successful connection.

The reason for MultipleActiveResultSets is because I'm using 2 MySqlDataReader at the same time - This however can't be changed.

If anyone knows why this is failing, then please suggest your fix.

My local MySQL server version: 5.6.17

like image 633
Ren Avatar asked Sep 20 '14 21:09

Ren


People also ask

What is Multipleactiveresultsets true in connection string?

Multiple Active Result Sets (MARS) is a feature that allows the execution of multiple batches on a single connection. In previous versions, only one batch could be executed at a time against a single connection. Executing multiple batches with MARS does not imply simultaneous execution of operations.

Does ado net support MySQL?

The ADO.NET Provider for MySQL offers the most natural way to access MySQL data from any . NET application. Simply use MySQL Data Provider objects to connect and access data just as you would access any traditional database. Our ADO.NET Provider for MySQL gives developers the power to easily connect .

How can I get connection string from MySQL server?

Specifying TCP/IP portDriver={MySQL ODBC 5.2 ANSI Driver};Server=myServerAddress;Port=3306;Database=myDataBase;User=myUsername;Password=myPassword;Option=3; The driver defaults to port value 3306, if not specified in the connection string, as 3306 is the default port for MySQL.

What is Mars connection in SQL?

Multiple Active Result Sets (MARS) is a feature that works with SQL Server to allow the execution of multiple batches on a single connection. When MARS is enabled for use with SQL Server, each command object used adds a session to the connection. Note.


1 Answers

I assume MySql connector doesn't support MARS (Multiple active result sets). In such case you cannot use it at more than one place at the same time.

like image 188
Pritam Avatar answered Sep 28 '22 04:09

Pritam