public DataSet SelectMySqlSrvRows(DataSet myDataSet,string myConnection,string mySelectQuery,string myTableName)
{
MySqlConnection myConn = new MySqlConnection(myConnection);
MySqlDataAdapter myDataAdapter = new MySqlDataAdapter();
myDataAdapter.SelectCommand = new MySqlCommand(mySelectQuery, myConn);
MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(myDataAdapter);
myConn.Open();
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, "Departments");
//code to modify data in dataset here
//Without the MySqlCommandBuilder this line would fail
myDataAdapter.Update(myDataSet, "Departments");
myConn.Close();
return myDataSet;
}