我不知道为什么我仍然遇到这个问题,这是我的下面的代码,感谢任何帮助。
public static DataTable DTTable(string mysqlQuery, string queryName) { lock (_object) { DataTable DTTableTable = new DataTable(); try { using (MySqlDataAdapter DataDTTables = new MySqlDataAdapter(mysqlQuery, MySQLProcessing.MySQLStatic.Connection)) { using (DataTable DataDTTablesDT = new DataTable()) { DataDTTables.SelectCommand.CommandTimeout = 240000; DataDTTables.Fill(DataDTTablesDT); DTTableTable = DataDTTablesDT; DataDTTables.Dispose(); } } } catch (Exception ex) { GenericLogging("Failed MySQLquery: " + ex.Message.ToString(), "MySQLProcessor", "DTTable", "", "MysqlError", "", queryName, mysqlQuery); } return DTTableTable; } }