本文介绍了我怎么不能在ASP中分配外键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有外键的类,在这里我从中定义一个对象并插入db中,我不分配外键,因为它必须在另一个页面中分配,并且我将外键分配为null,但是我得到了此错误:
无法将值NULL插入表"HomeWorkSystem.dbo.Course"的"GdtStdUN"列中;列不允许为空. INSERT失败.该声明已终止.
谢谢你
Hi, I have class that has a foreign key, where i define an object from it and insert in db i don''t assign foreign key because it must assign in another page and i assign foreign key to null but I get this error:
Cannot insert the value NULL into column ''GdtStdUN'', table ''HomeWorkSystem.dbo.Course''; column does not allow nulls. INSERT fails. The statement has been terminated.
thank you
推荐答案
这篇关于我怎么不能在ASP中分配外键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!