表之间的数据传输 [英] Data transfer among tables

查看:76
本文介绍了表之间的数据传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2个表的数据集
客户联系
情况
CustomerContact是父"列
情况是子列
------------
我想根据某些条件将另外2个表添加到数据集中..
带-1作为ID列的Shadow_CustomerContact
Shadow_Situation

情况应移至Shadow_CustomerContact
CustomerContact应移至Shadow_CustomerContact
客户联系和情境中的数据应删除

我想在daaset中执行此操作,然后将相同的数据集传递给我的第3方工具,该工具将保存在数据库中.
请帮帮我

[edit]删除了重复的文本-OriginalGriff [/edit]

I have a dataset which has 2 tables
CustomerContact
Situation
CustomerContact is Parent column
Situation is a child column
------------
I want to add 2 more tables into dataset based upon some condition..
Shadow_CustomerContact with -1 as ID column
Shadow_Situation

Situation should move into Shadow_CustomerContact
CustomerContact should move into Shadow_CustomerContact
Data from CustomerContact and Situation should get deleted

I want to do this in daaset, then i will pass same dataset to my 3rd party tool which will save in Database.
Please help me out

[edit]Duplicate text removed - OriginalGriff[/edit]

推荐答案

我认为LINQ可能是解决这一问题的方法...
否则,我认为您正在谈论的是DataTable而不是DataSet.如果我没记错的话,DataSet是基于来自数据库的查询的,那么您将无法向其中添加列(我可能是错的,但是我认为之前也有同样的问题),但是如果您创建了DataTable您可以在列中拥有所需的任何内容.
I''m thinking LINQ may be the way to go with this one...
Otherwise I think what you are talking about is a DataTable not a DataSet. If I remember correctly a DataSet is based off a query from a database so you won''t be able to add columns to it (I could be wrong, but I think I had the same problem before), but if you create a DataTable you can have what ever you want in it for columns.


这篇关于表之间的数据传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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