Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
539 views
in Technique[技术] by (71.8m points)

c# - 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...