将更改从一个数据库表复制到另一个数据库表 [英] Copy Changes From One Database Table to Another

查看:68
本文介绍了将更改从一个数据库表复制到另一个数据库表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个讨论中也提出了类似的问题,鲁珀特·戴维斯(Rupert Davis)给了我一个很好的答案,但它似乎无法按我需要的方式工作.我启动了一个新线程,以便可以对Q& A进行更具体的说明.

我正在使用C#2010做数据库管理器.其中一部分是库存管理.我有一个名为库存"的表格,另一个叫做报告".

我正在尝试对广告资源"进行任何更改,保存到报告"使管理者更容易打印和查看最近的更改.这两个表是相同的,除了"Report"是相同的.添加了一个字段 标记更改时间的时间戳.我该如何进行保存"操作?按钮更新第一个表并将更改保存到第二个表?我之前的问题建议使用列表框或数据网格保存更改,但对于 程序的目的,显然是行不通的.有任何建议吗?

解决方案

如果要在数据库级别为您进行第二次插入,我将在清单表上使用更新触发器.

I've asked a similar question on another discussion, Rupert Davis gave me a good answer but it doesn't seem to work like I need it to.  I started a new thread so that the Q&A can be a little more specific.

I'm making a database manager using C# 2010.  Part of it is inventory management.  I've got a table called "Inventory" and another called "Report.

I'm trying to make any changes made to "Inventory" save to the "Report" to make printing and viewing the recent changes easier for the managers.  The two tables are identical except that "Report" has one field added for a time stamp to mark when the changes were made.  How can I make the "Save" button update the first table and save the changes to the second?  My previous question suggested using a listbox or a datagrid for saving the changes, but for the purposes of the program, that apparently won't work.  Any advice?

解决方案

I would use an update trigger on the inventory table have it do the second insert for you at the database level.


这篇关于将更改从一个数据库表复制到另一个数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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