예제 #1
0
 /// <summary>
 /// Updates the given table with data from the given <see cref="DataSet"/>
 /// </summary>
 /// <param name="connectionString">Settings to use for the update</param>
 /// <param name="commandText">Command text to use for the update</param>
 /// <param name="ds"><see cref="DataSet"/> containing the new data to use in the update</param>
 /// <param name="tablename">Tablename in the dataset to update</param>
 public static void UpdateDataSet(string connectionString, string commandText, DataSet ds, string tablename)
 {
     MySqlConnection cn = new MySqlConnection(connectionString);
     cn.Open();
     MySqlDataAdapter da = new MySqlDataAdapter(commandText, cn);
     MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
     cb.ToString();
     da.Update(ds, tablename);
     cn.Close();
 }