MySQL Programming

Amos Xia, 2018-04-30 13:28:12

介绍C#中如何使用MySQL Connect和MySQL进行交互

Connection Management

Use MySqlConnection for connection with MySQL, it requires Connect String to establish connection.

When connection raised error, it will raise MySqlException

Connection Models: - Continual Model, connect/close manually, Use MySqlCommand to operate MySQL. + ExecuteReader, must to be closed after used + ExecuteNonQuery + ExecuteScalar - Decoupled Model, connect/close automatically when necessary. + DataSet + MySqlDataAdapter + MySqlCommandBuilder

Connection Pooling is ennabled by default and configured in connect string.

Use Prepared Statements to improve performance of statement execution.

Use Trace Source Check trace info to improve performance of MySQL operations.



知识共享许可协议
本作品采用知识共享署名 4.0 国际许可协议进行许可。


Copyright© 2018 s2u2m