使用c#将更改从表更改到另一个sql server中的另一个表 [英] put changes from a table to another table in another sql server with c#

查看:106
本文介绍了使用c#将更改从表更改到另一个sql server中的另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个网站,我想通过Windows应用程序管理它的数据库。

数据库中有一些信息位于我的电脑中这些信息总是在变化。

现在我要把这些变化放到网站数据库中。

我不知道怎样才能找到变化我必须插入,当我必须更新每一行。



你能告诉我一个简单的解决方法吗?





ok我会描述更多。



我有一个网站,我在那里出售一些产品。有一个包含产品信息的数据库。我的计算机中还有一个数据库,用于指示存储中有多少产品。

现在我需要创建一个应用程序,将位于我的计算机中的数据库中的信息复制并替换为数据库例如,今天我将添加一个产品,或者我将在我的计>


如前所述,有两个不同的数据库,包括产品信息,我将保持它们始终相同。



我该怎么做?

Hi everyone
I have a website and I want to manage its database through a windows application.
there are some information in a database has located in my computer and these information always change.
Now I''m going to put these changes into database of website.
and I don''t know how can I find changes and when I have to insert and when I have to update each rows.

could you please introduce me a simple way to solve that?


ok I will describe more.

I have a website that I sell some products there. there is a database including information of products. I also have a database in my computer that indicate how many products there are in storage.
Now I need to make an application that copy and replace information from the database that located in my computer to the database that located in internet.
for example, today I will add a product or I will change a product in the database in my computer and I want to set these changes into the database located in internet.

as I said before, there were two different databases including products information and I am going to keep them always the same.

how can I do that?

推荐答案

问题对我来说不是很清楚。我想你需要存储行版本。如果是这样,你想创建一个单独的表,它就是所谓的历史表。当需要主表插入/更新/删除操作时,在此之前,您只需将主表中的最后一行复制到历史表中,并使用专用标识/版本号等,您可以遵循各种策略。因此,当前一行需要时,您可以转到历史表并选择合适的行版本。





那么,你需要开发一个webservice / wcfservice。它将从互联网上添加/更新产品数据库。当您添加/更新产品时,从您的本地环境(Windows / Web),您还调用新开发webserivce以与您的本地数据库同步Internet数据库。如果您是webserivice世界的新手,那么您首先需要正确理解它,然后才能实现它。
Question not very clear to me. I guess you need to store row version. If so you want to create a separate table, it is so called history table. When main table insert/update/delete operation will need, before that you just copy last row from main table to history table with appropriation identification/version no etc various strategy you can follow. So when previous any row needed then you can go to history table and pick appropriate row version.


Well, Then you need to develop a webservice/wcfservice. It will add/update product database from the internet. From your local environment(windows/web)when you add/update product that time you also call that newly develop webserivce for sync internet database with your local database. If you are new to webserivice world then you first need to understand it properly then you can implement that.


这篇关于使用c#将更改从表更改到另一个sql server中的另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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