- Joined
- 31 Dec 2003
- Posts
- 5,172
- Location
- Barrow-In-Furness
All was well, realised I had a slight mistake in my database design and I needed to add a third primary key, this has ruined the auto-generated update commands created by the DataSet.
I've tried re-creating the tableAdapter and the web page but no joy.
When I try edit an item i'm getting the following error:
"ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: Hours, Comments, Approved, original_TimeCode, original_Date, original_Username."
The update query that is generated looks like this:
And finally, the table looks like this...
tblHours
ID
TimeCode - PK
Date - PK
Hours
Username - PK
Comments
Approved
The reasoning behind the three primary keys is to ensure that a user can not log hours for the same Date and Timecode more than once.
Anyone got any ideas? I'm lost here and my SQL knowledge is far from great
I've tried re-creating the tableAdapter and the web page but no joy.
When I try edit an item i'm getting the following error:
"ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: Hours, Comments, Approved, original_TimeCode, original_Date, original_Username."
The update query that is generated looks like this:
Code:
UPDATE tblHours
SET TimeCode = @TimeCode, Date = @Date, Hours = @Hours, Username = @Username, Comments = @Comments, Approved = @Approved
WHERE (TimeCode = @Original_TimeCode) AND (Date = @Original_Date) AND (Username = @Original_Username)
And finally, the table looks like this...
tblHours
ID
TimeCode - PK
Date - PK
Hours
Username - PK
Comments
Approved
The reasoning behind the three primary keys is to ensure that a user can not log hours for the same Date and Timecode more than once.
Anyone got any ideas? I'm lost here and my SQL knowledge is far from great
