DA table definitions, casting between table classes

I have a DA class lib that holds all my table definitions. I’ve recently added a set of three new tables which are the EXACT same structure of three other tables. These will be utilized to retain some deleted data for various reporting purposes. I had hoped that when i filled this table upon deleting a set of records, i could simply clone the original record, and cast it to the new class type, and insert into the new table via DA LINQ. Unfortunately, DA is not letting me do that and saying i cant cast Type1 as Type2.

Is there any way to get around this other than instantiating a new table2, and filling in all hte fields via code?

Not DA. This is how strongly typed programming languages work - one just cannot assign object of type A into a variable of type B without defining a way to cast type Atype B (unless type A is inherited from type B).

You need to either write type transition code manually or use a tool like AutoMapper ( https://automapper.org/ )

This is a simple sample where AutoMapper is used to perform conversion between different types: WindowsApplication2.zip (587.4 KB)