Closed yuzd closed 3 years ago
No, database connections are not thread-safe
//in linqpad you must new connection by selft to make sure thread-safe
using DataConnection db = new DataConnection("MySqlConnector","Server=127.0.0.1;Port=3306xxxxxxxxxxxxxxxxxxx");
To clarify it a bit: database connections in general and in ADO.NET specifically not designed to be thread safe and I actually not aware of any provider to declare being thread-safe in this area. And because DataConnection is an abstraction over database connection, it is also not thread-safe.
ok i got it.. thanks
err:
Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first.