public static MySqlDataReader ExecuteReader(string connectionString, string commandText, params MySqlParameter[] commandParameters) { MySqlDataReader reader; MySqlConnection connection = new MySqlConnection(connectionString); connection.Open(); try { reader = ExecuteReader(connection, null, commandText, commandParameters, false); } catch { connection.Close(); throw; } return reader; }
public static void UpdateDataSet(string connectionString, string commandText, DataSet ds, string tablename) { MySqlConnection connection = new MySqlConnection(connectionString); connection.Open(); MySqlDataAdapter adapter = new MySqlDataAdapter(commandText, connection); new MySqlCommandBuilder(adapter).ToString(); adapter.Update(ds, tablename); connection.Close(); }