Beispiel #1
0
 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();
 }
Beispiel #2
0
 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;
 }