Mysql connector - MultipleActiveResultSets issue

前端 未结 3 918
鱼传尺愫
鱼传尺愫 2020-12-06 21:12

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

相关标签:
3条回答
  • 2020-12-06 21:21

    The problem is not solved but I have found a work around.

    I removed MultipleActiveResultSets=True; from the connection string. I then created a list where I saved the data from MySqlDataReader, I then closed the reader and reopen a new one which then I got the rest of the data from the database. Then simply merged the results together in the list.

    So yeah, a temp fix.

    If someone knows the proper fix then please comment, otherwise I will be using my temp fix.

    Thanks guys.

    0 讨论(0)
  • 2020-12-06 21:25

    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.

    0 讨论(0)
  • 2020-12-06 21:35

    One more option which can cause a little performance hit but can be used as quick fix is to open one more connection to the database for the second reader and close it when you are done.

    0 讨论(0)
提交回复
热议问题