Imar
Thanks for the suggestion. The primary key for both tables is set to the ID column. Both fields are int and Identity columns.
There is another related problem which is the DataGrid will not allow an Insert.
Is there another reason for this behaviour? Perhaps the way SQL Server Express is configured?
I thought I would try to generate the SQL to create the table to prove it had a primary key and was an Identity column.
So I tried to access the PlanetWrox database using SSMS from a Developer version of SQL Server 2008. The PlanetWrox database did not show under the SQLExpress Server, so I attempted to make an attachment to PlanetWrox.mdf. This resulted in this error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'PGDT\SQLEXPRESS'. (Microsoft.SqlServer.Smo)
For help, click:
http://go.microsoft.com/fwlink?ProdN...r&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Unable to open the physical file "C:\BegASPNET\DatabaseTest\App_Data\PlanetWrox.mdf ". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)
For help, click:
http://go.microsoft.com/fwlink?ProdN...0&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------