public DataSet SelectDB2SrvRows(DataSet myDataSet,string db2Connection,string mySelectQuery,string myTableName)
{
DB2Connection myConn = new DB2Connection(db2Connection);
DB2DataAdapter myDataAdapter = new DB2DataAdapter();
myDataAdapter.SelectCommand = new DB2Command(mySelectQuery, myConn);
DB2CommandBuilder db2CommandBuilder = new DB2CommandBuilder(myDataAdapter);
myConn.Open();
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, "Departments");
//code to modify data in dataset here
//Without the DB2CommandBuilder this line would fail
myDataAdapter.Update(myDataSet, "Departments");
myConn.Close();
return myDataSet;
}