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 sta开发者_开发问答rt 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...)
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
精彩评论