hi
I am using the lastest version of LLBLGen and adapter , I have to move some data from MySql and save to an xml file , the basic code I am using is below and it works, I need to do the same thing on maybe 20 other tables, I can just cut and past the code and manually change the adapter and field objects, but it would be nice to be able to pass the objects in somehow, so that when I need to do maintenance I change to code in one place.
RelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add(DropsFields.Mydown == 0);
DataAccessAdapter adapter = new DataAccessAdapter();
DataSet ds = new DataSet();
DropsEntity oDrops = new DropsEntity();
DataTable dt = new DataTable();
ISortExpression sorter = new SortExpression(DropsFields.stamp | SortOperator.Ascending);
adapter.FetchTypedList(oDrops.Fields, dt, filter, this.maxFiles,sorter,false);
ds.Tables.Add(dt);
string fileName = lcTarget + this.oFileStuff.createFileName(lcFileType);
dt.WriteXml(fileName);
EntityCollection<DropsEntity> oDropsCol = new EntityCollection<DropsEntity>();
int i = 0;
foreach (DataRow row in ds.Tables[0].Rows)
{
Int64 eventid = (Int64)ds.Tables[0].Rows[i]["eventID"];
DropsEntity oDrop = new DropsEntity(eventid);
oDrops.Mydown = 1;
oDropsCol.Add(oDrops);
i = i + 1;
}
adapter.SaveEntityCollection(oDropsCol);
hope that all makes sense I have only just started using LLBLGen
TIA
Stuart