C#数据集将两个表的密钥调整在一起

时间:2015-11-28 15:24:15

标签: c# dataset

我开始使用数据集。我从XML文件加载数据。

我有1张桌子 GoodGuys 看起来像:

  1. GoodGuyId(int,auto_increment = true)
  2. GoodGuyName(字符串)
  3. GoodGuyPicture(字符串)
  4. 我有第二张桌子 BadGuys 看起来像:

    1. BadGuyId(int,auto_increment = true)
    2. BadGuyName(字符串)
    3. BadGuyPicture(字符串)
    4. 问题是,我必须像下面的列表一样调整id。当新行相互添加时,两个表中都没有相同的ID

      1. GoodGuyId => 0 ,GoodGuyName => ...,GoodGuyPicture => ...
      2. GoodGuyId => 1 ,GoodGuyName => ...,GoodGuyPicture => ...
      3. BadGuyId => 2 ,BadGuyName => ...,BadGuyPicture => ...
      4. GoodGuyId => 3 ,GoodGuyName => ...,GoodGuyPicture => ...
      5. BadGuyId => 4 ,BadGuyName => ...,BadGuyPicture => ...
      6. 是否有自动方式将它们整合在一起?

0 个答案:

没有答案