I have a table TaskSchedule
. It has a three-part primary key and two more values:
IdTask PK
IdPerson PK
StartTime PK
EndTime
Remarks
IdTask
and IdPerson
are also foreign keys. The idea is that you can write down which person worked on which task in which period of time. We suppose that those three stuff will be sufficient to specify uniqueness of the entry.
I'd have no problem with this in PHP. Probably I would manage to write this manually in ASP.NET; but since this is a project for a class at university, and I'm not particularly personally interested in either C# or ASP.NET...
We've basically been taught to do this by creating a simplistic SqlDataSource
and creating a GridView
that's bound to it. Unfortunately, everyone else was assigned tables with single PK, while my assignment logically (I believe) asks for three-part primary key. I have also set up the Windows Forms application to work properly with such a database; this is primarily the reason why adding a single "artificial" primary key identity/autoincrement column is no longer an option (considering the deadline).
Individual primary key columns are not really editable. In autogenerated UPDATE command, anything specified in DataKeys property of the SqlDataSource
is used in WHERE statement, and not in the main portion of the statement. Removing the columns from DataKeys would mean transferring the trouble to the autogenerated delete link and the DELETE statement.
So:
What would, in your opinion, be the proper way to make the primary key columns editable?