如何插入数据? [英] How to Insert Data?

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

问题描述

我怎么可以将数据插入到Access数据库其中有一个用C#加入内?的多个表

How i can insert data into more than one table of an Access database which have a join of inner by using C#?

推荐答案

我想通过参加你的意思是一个外键到另一个表的关系。联接引用查询不表。

I assume by join you mean a relationship with a foreign key to another table. Joins refer to queries not tables.

您可以简单地做多个插入,一是根据需要,将记录添加到父表,让您刚才添加的新记录的键,然后做插入到任何子表使用该ID,这将是每个表外键的子表。

You can simply do multiple inserts, one to each table as required, add the record to the parent table, get the key of the new record you just added, then do the inserts to any child tables using that ID which would be the foreign key in the child table.

这篇关于如何插入数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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