在从一个表复制到另一个表时插入每个记录 [英] insert into each record as you copy from one table to another

查看:89
本文介绍了在从一个表复制到另一个表时插入每个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

i非常感谢你的帮助

i有两个表:1)tblStudent(Studentid,studentName,Class)和2)tblStudentYear(StudentID,StudentName,Class,年)。

i需要将tblStudents中的所有学生姓名,ID和班级复制到tblStudentYear并复制每个学生,插入年份(写在textbox1中)

am using vb .net

hello
i will really appreciate your help
i have two tables: 1) tblStudent (Studentid,studentName,Class) and 2) tblStudentYear (StudentID, StudentName, Class, Year).
i need to copy all students name, id, and class in tblStudents to tblStudentYear and for each student copied, insert year (written in textbox1)
am using vb.net

推荐答案

您好,



您可以按照以下步骤完成您的要求



1.将表1中的所有数据复制到表2

2.通过自定义获取数据网格/网格视图中的数据,即提供文本框今年。

3.一次更新系统中的详细信息。



我希望这对你有帮助。





干杯


you can follow these steps to complete your requirement

1. Copy all data from table 1 to table 2
2. Fetch that data in data grid / grid view with customization i.e. with provision of text box for year.
3. Update the details in system in one go.

I hope this will help you.


Cheers


如果是一次性需要,你可以在声明中插入SQL插件。这里您正在使用相同的源表设计创建新表。



If it is a one time need , you can go for a SQL insert into statement.Here you are creating new table with the same design of source table.

INSERT INTO table2
SELECT * FROM table1;





在此处查找更多内容 [ ^ ]


我复制了所有的数据然后循环更新..代码。

感谢所有人的帮助
I copied all the data then looped the "Update.." code.
thanks all for your help


这篇关于在从一个表复制到另一个表时插入每个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆