public DataSet SelectMagentoSrvRows(DataSet myDataSet,string magentoConnection,string mySelectQuery,string myTableName)
{
MagentoConnection myConn = new MagentoConnection(magentoConnection);
MagentoDataAdapter myDataAdapter = new MagentoDataAdapter();
myDataAdapter.SelectCommand = new MagentoCommand(mySelectQuery, myConn);
MagentoCommandBuilder magentoCommandBuilder = new MagentoCommandBuilder(myDataAdapter);
myConn.Open();
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, "Departments");
//code to modify data in dataset here
//Without the MagentoCommandBuilder this line would fail
myDataAdapter.Update(myDataSet, "Departments");
myConn.Close();
return myDataSet;
}