|
There are two tables A and B (different users). Table B has one more column than table A, and the remaining columns are all the same.
Now I want to implement such an operation, which is to add the data of table A to table B.
Idea: (Prerequisite: a dsA.xsd (dataset file) already exists but no dsB.xsd)
1. Take out all the data in table A and put it into datasetA.
2. Add a column to datasetA, write a value to this column, and get a modified datasetA.
3. Create a datasetB of B, and add the data of datasetA to datasetB
4. Save datasetB and update the database.
However, a problem occurred. Because in this project, to update a library table, you need to call a save method in the data layer. For example, if I want to update table A, I need to call the save method in the data layer file corresponding to A. Enter datasetA, the type is dsA. Then update according to different users.
Because there are so many similar tables, it is required that the type B tables use the data access layer of the type A tables (the type B tables have no other operations except to save the information of the table A)
Because the input type of the save method is a specific type, such as dsA (dsA.xsd), rather than an ordinary dataset, the structure of the table in dsA has been determined, one column less than B, and B has no data layer. So I have to call A's save method to save B, but it won't work. I would like to ask, is it possible to save in this case? Is there a way to dynamically add a column in dsA so that no errors occur due to the difference in the number of columns when saving. Thank you. If I didn't explain it. Excuse me. I'm waiting online! !! |
|