且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

插入到许多一对多的关系表

更新时间:2022-12-30 18:28:05

通常情况下,你必须确保该链接的表插入之前存在,或者,你可能会得到一个错误(如果你已经制约你的SQL表依赖)。

Typically you have to insure that the linked tables exist before the insert or you may get an error (depends if you have constrained your sql tables).

您还可以创建自定义存储过程的插入和更新要求,这些程序可以保证链接表是正确的

You can also create custom stored procedure calls for the inserts and updates, these procedures could insure the linked tables are correct.

恕我直言LINQ到SQL是好的制作复杂的选择,但不是那么容易用于更新数据库。 (通常,我见过它造成严重的性能瓶颈。)

IMHO linq-to-sql is good for making complicated selections but not so easy to use for updating the database. (Often I've seen it create serious performance bottlenecks.)