使用Visual Studio的SQL Server CE中的外键 [英] foreign key in sql server CE using Visual studio

查看:163
本文介绍了使用Visual Studio的SQL Server CE中的外键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有带有SQL CE数据库(SDF)的C#项目
数据库有2个表
我用datagridview在form1中显示table1信息
并使用bindnavigator在form2中显示table2信息
我想在表1中输入数据,然后单击表1中的"button1"
在表格2中,bindnavigator会自动更新,并且table2的单元格也会自动更新
这是项目文件
http://up3.iranblog.com/images/msc1jxfs4n0f967jn63.rar [解决方案

我不明白您的最后一行,只需清除它即可.


ALTER TABLE订单
添加约束FK_Customer_Order
外键(CustomerId)参考客户(CustomerId)


感谢您的答复
但是我在哪里输入此命令呢???在Visual Studio中?
我给我的项目
我说是使用Visual Studio
我没有管理工作室


hi i have c# project with sql CE database(sdf)
database have 2 table
i show table1 information in form1 with datagridview
and show table2 information in form2 with bindnavigator
i want when i enter data in table 1 then click to "button1" in form 1
in form 2 ,bindnavigator update automatically and also table2''s cell update automatic
this is project file
http://up3.iranblog.com/images/msc1jxfs4n0f967jn63.rar[^]
sorry for bad english
please help me

解决方案

i am not understanding your last line.just clear it.


ALTER TABLE Orders
ADD CONSTRAINT FK_Customer_Order
FOREIGN KEY (CustomerId) REFERENCES Customers(CustomerId)


thank you for response
but where i enter this command''s??? in visual studio?
i give my project
i say is use visual studio
i have not management studio


这篇关于使用Visual Studio的SQL Server CE中的外键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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