如何使用linq将所有列值从一个表复制到另一个表。 [英] How to copy all the column values from one table to another using linq.
本文介绍了如何使用linq将所有列值从一个表复制到另一个表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用linq将所有表列值从一个表复制到另一个表。
除了使用触发器外没有其他出路吗?
我尝试过的方法:
我试图在网上搜索但没有找到任何令人满意的结果。
I want to copy all table column values from one table to another using linq.
Isn't there any other way out except using trigger?
What I have tried:
I tried to search on net but haven't found anything satisfactory.
推荐答案
你可以复制每一行从一张桌子到另一张桌子,
例如:
数据库名学生
表table1和表2
SQLiteAsyncConnection连接=新的SQLiteAsyncConnection(Student.db);
var table1list = await connection.table1.ToListAsync();
连接。 table2.InsertAllAsync(table1list);
i认为它会起作用
you can copy each row from one table to another,
for ex:
database name student
tables table1 and table 2
SQLiteAsyncConnection connection = new SQLiteAsyncConnection("Student.db");
var table1list = await connection.table1.ToListAsync();
connection.table2.InsertAllAsync(table1list);
i think it will work
这篇关于如何使用linq将所有列值从一个表复制到另一个表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文