|
vodkasoda
Starting Member
Ireland
15 Posts |
Posted - 03/04/2013 : 17:40:00
|
I am new to SQL Server, but have exposure to databases on Mainframe & MS Access, but this is giving me a headache ...
I am using VB2010 Express and used Project Add New Item to add a SQLCE 3.5 Database to my small program.
I then created 2 Tables, called "Leagues" & "Teams", by right clicking on the Tables tab in Database Explorer.
I have used the Solution Explorer to open the DataSet and add a Foreign Key. This is what I now have :
Table1 : Leagues
ID - PK, AutoIncrement = True, 1, 1, DataType = System.Int32, Unique = True
Name
Table2 : Teams
ID - PK, AutoIncrement = True, 1, 1, DataType = System.Int32, Unique = True
Name
LeagueID - FK, AutoIncrement = False, DataType = System.Int32, Unique = False
However, if I right-click on the Table name in Database Explorer & choose Show Table Data, so I can enter a Test entry, it gets rejected with an error message telling me that the ID column cannot be Null ... so why is it not AutoIncrementing ?!? This happens if I try to enter a Test entry into either Table ... |
|
|
vodkasoda
Starting Member
Ireland
15 Posts |
Posted - 03/05/2013 : 02:18:01
|
Well in this instance I am creating (or trying to) 1 single record for Test purposes, I have no intention of typing in every entry when I load the real data ...
I am now using nvarchar & have not specified Unique for my Key & will revisit this in future if I feel the need, for now you can close this question ... |
Edited by - vodkasoda on 03/05/2013 04:25:25 |
 |
|