Hello,
I want to copy all the data from database A Table Admin to Database 2 Table Admin. Both tables are identical, but each one belong to a diferent DataLayer. Both are Access Databases.
Data Layers are generated using:
Name: SelfServicing, general scenario Vs.Net 2005
Version: 1.0.2005.1.10232005
Vendor: Solutions Design
Description: SelfServicing. Generates one entity class per entity. Validator classes are initially created but never overwritten. It will also create a VS.NET 2005 project file, however will never overwrite this file.
I tried the folliwng code bellow
//Create Collection Objects
FPS_DataLayer.CollectionClasses.AdminCollection AdminTableSource = new FPS_DataLayer.CollectionClasses.AdminCollection();
Geo_DataLayer.CollectionClasses.AdminCollection AdminTableTarget = new Geo_DataLayer.CollectionClasses.AdminCollection();
//Full table loads
AdminTableSource.GetMulti(null);
AdminTableTarget.GetMulti(null);
//Delete all records
AdminTableTarget.DeleteMulti(Geo_DataLayer.HelperClasses.AdminFields.StdId > 0);
//Create Iteration Object
foreach (FPS_DataLayer.EntityClasses.AdminEntity adminSource in AdminTableSource.Items)
{
Geo_DataLayer.EntityClasses.AdminEntity adminTarget = (Object)adminSource;
AdminTableTarget.Add(adminTarget );
}
AdminTableTarget.SaveMulti();
I got an error with the Object Conversion, becuase the EntityClass from the FPS and the Geo_DataLayer are not the same...althoguth they represent the same object/row.
How do I solve this issue. Do I map field by field like: ObjectA.Field1 = Objectb.Field2??? or there is another faster way??
Thanks,
BG.