sql server或C# [英] sql server or C#

查看:81
本文介绍了sql server或C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建了一个带有记录控件和表格控件的表单,我的记录控件为
2下拉列表中的项目名称和软件包编号.
表格控制文本框:商店,位置,联系人,项目,数量,

数据库表:
项目表:
project_ID Pk int身份
客户名称
项目名称


包装表:
package_ID PK int身份
project_ID fk
包裹编号
包裹名称

储物桌
Store_ID Pk int身份
package_ID fk
店铺名称
位置
合同
项目
数量



我的问题是,当我去保存时,我得到了一个与外键约束"相冲突的错误插入语句.
它试图插入

created a form with a record control and table control my record control as
2 drop down list project name and package numbers.
table control text boxes: store, location, contact, item, qty,

database tables:
projects table:
project_ID Pk int Identity
Client Name
project name


Package table:
package_ID PK int Identity
project_ID fk
Package Numbers
Package Name

Store table
Store_ID Pk int Identity
package_ID fk
Store Name
Location
Contract
items
qty



My problem is that when I go to save I get a error insert statement conflict with the foreign key constraint "".
it''s trying to insert a

推荐答案

您很可能没有提供必要的外键,但没有显示您如何插入我们无法帮助的记录您.
You are most likely not supplying a necessary foreign key but without showing how you are inserting the records we can''t help you.


您违反了有关外键约束的SQL规则.问题是您正试图在需要将父表提供外键的表中插入一行.

对于给定的表,必须按以下顺序插入到表中:

1.项目
2.包
3.商店

检查插入语句顺序

戴夫
You are violating SQL rules on a foreign key constraint. The problem is you are trying to insert a row into a table that required a foreign key to be supplied by a parent table.

For the tables you have given, you have to insert to the tables in the following order:

1. Projects
2. Package
3. Store

Check the insert statement order

Dave


这篇关于sql server或C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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