Visual studio 2008。我不记得要做什么事情
我正在帮助一位朋友完成他的 C# 作业,但是由于我在 .NET 中没有做任何事情,所以已经很长时间了。您能帮助我解决我在使用 Visual Studio 2008 时遇到的一些困难吗?
问题1
如何让表的主键自动自增?那个选项在哪里?我在界面的任何地方都没有看到它。
问题 2
如何在 2 个表之间创建关系?我认为我做得正确,但我没有看到任何迹象表明我做对了:
这就是我开始建立关系的方式:
然后我配置与向导的关系:
但最后我没有看到任何图标或符号表明这是一种关系:
问题3
我想以最简单的方式开始直接在数据库中添加数据最快的方法(执行插入查询)。你能给我一些关于如何做到这一点的小提示吗?(我不需要其他方法,例如数据集......)
I am helping a friend with his C# homework, but is being a long time since i don't do nothing in .NET Could you please me give me a hand to solve some difficulties i have with visual studio 2008?
Problem 1
How can i make a primary key of a table be auto incremented automatically? Where is that option? i don't see it in my interface anywhere.
Problem 2
How can i create a relationship between 2 tables? I think i am doing it correctly, but i don't see any sign that i did things right:
This is how i start creating the relationship:
Then i configure the relationship with the wizard:
But at the end i don't see any icon or symbol that indicates me that this is a relationship:
Problem 3
I want to start adding data in the database directly in the easiest and fastest way(Executing an Insert query). Could you give me a little tip on how to do that?(I don't want other approaches such as dataset...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题1:
将 isIdentity 设置为“是”
将 IdentityIncrement 设置为“1”(这意味着它将为每个新行的 id 添加 1)
将 IdentitySeed 设置为“0”(这意味着它将以 0 ..然后 1 ..然后 2 ...等等开始)
问题 2:
您的操作非常正确。您不会看到任何图标或任何内容,但右键单击并转到“关系”后,您将看不到任何图标或任何内容。在左侧表格中,您可以看到关系已创建 (
FK_learner_student
) ,请在 2:00 标记 > > 后观看此视频。 http://www.youtube.com/watch?v=IXz5fpoopNo 。它的作用完全一样。或者这个官方教程:http://msdn.microsoft.com/en-us/库/ms189049.aspx
Problem1:
Set the isIdentity to 'Yes'
Set IdentityIncrement to '1' (it means it will add 1 to the id for every new row)
Set IdentitySeed to '0' (it means it will start with 0 ..then 1 ..then 2 ...so on)
Problem2:
Your doing it pretty much correctly. You won't see an icon or anything but once you right-click and go to Relationships. On the left hand table you can see the relationship was created (
FK_learner_student
) ,Take a look at this video after the 2:00 mark > http://www.youtube.com/watch?v=IXz5fpoopNo . It's doing exactly the same. Or this official tutorial : http://msdn.microsoft.com/en-us/library/ms189049.aspx