SQL Class and threads together

-1

I am developing a project using the SQL class I created that has efficient functions that I created and also exists in my class link for database connection.

I encountered a problem that when 2 separate threads use the class they both use the same connection and it is not possible I get an error.

MySql.Data.MySqlClient.MySqlException
  HResult=0x80004005
  Message=There is already an open DataReader associated with this Connection which must be closed first.
  Source=MySql.Data

I know now that I need to divide my class into several connections as a result of using threads, I wanted to ask if anyone was having the same problem and thought of an interesting way to solve it And even if not and he has a creative way, Thanks :)

c#
mysql
.net
multithreading
asked on Stack Overflow Aug 17, 2019 by Dan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0