将数据库与Asp.net和C#一起使用 [英] Using the database with Asp.net and C#
本文介绍了将数据库与Asp.net和C#一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有4个表:produtmastertable,productdetailtable,plugintable和plugindetailtable
现在,我使用asp.net添加新产品,条目将进入productmastertable.现在我要限制的是,每当有产品添加时,则在pluginmastertable中仅添加新的插件.
那我该怎么办?
I have 4 tables : produtmastertable , productdetailtable , plugintable and plugindetailtable
Now i add new product using asp.net and the entry is going in the productmastertable . Now i want to restrict that whenever there is a product add then only new plugin is added in the pluginmastertable .
So what i have to be do?
推荐答案
向您的pluginmastertable中添加一个引用productmastertable主键的外部变量.同样,Plugins
和Products
为表命名比您给它们命名的更好.
Add a foreign to your pluginmastertable that references the primary key of the productmastertable. AlsoPlugins
andProducts
make better names for tables than the names you have given them.
这篇关于将数据库与Asp.net和C#一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文