简体   繁体   English

与linq的关系SQL C#

[英]relationship SQL C# with linq

I'm studying Linq, I have a table with a relationship between processos.idProcesso and ProcessosDetalhe.id_ProcessosDetalhe, but, when I try to add the informations in DataBase, I get one error: 我正在研究Linq,我有一张表格,其中的processos.idProcesso和ProcessosDetalhe.id_ProcessosDetalhe之间有关系,但是,当我尝试在数据库中添加信息时,出现一个错误:

错误

数据库

I tried to use the Add function, but, I can't use the add function in datacontex So, how I can solve that error ?? 我试图使用Add函数,但是,我不能在datacontex中使用add函数,那么,如何解决该错误? or, what I need to make in SQL to correct that error ? 或者,我需要在SQL中做些什么来纠正该错误?

添加错误数据上下文

The error mean that in your table ProcessosDetalhes, it has a foreign key reference to another table. 该错误意味着在您的表ProcessosDetalhes中,它具有对另一个表的外键引用。 The FK cannot have a value in that column that is not also in the primary key column of the referenced table. FK在该列中不能有一个值,该值也不能在被引用表的主键列中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM