- Joined
- 31 Dec 2003
- Posts
- 5,172
- Location
- Barrow-In-Furness
See post 4 for new problem!
My initial testing has gone well and thanks for everyone who has helped me
Just to make things 'nicer' though, i'm looking for some help.
I'm storing employee hours in a timesheet database, at the moment they will select a TimeCode to book hours too, to make this easier I would like to have them select the name of the TimeCode, but for the value to be stored as the CodeID.
I know if you add values manually to a DropDownList this is fairly easy, but the list will need to be populated by a Query.
I'm not sure of the easiest way to go about this, i'm i'll need to write some sort of query (or should I try do it in code?) that will fetch the ID based on the name, and then insert that instead?
My insert query at the moment is fairly typical...
Thanks for any help guys
My initial testing has gone well and thanks for everyone who has helped me

Just to make things 'nicer' though, i'm looking for some help.
I'm storing employee hours in a timesheet database, at the moment they will select a TimeCode to book hours too, to make this easier I would like to have them select the name of the TimeCode, but for the value to be stored as the CodeID.
I know if you add values manually to a DropDownList this is fairly easy, but the list will need to be populated by a Query.
I'm not sure of the easiest way to go about this, i'm i'll need to write some sort of query (or should I try do it in code?) that will fetch the ID based on the name, and then insert that instead?
My insert query at the moment is fairly typical...
Code:
INSERT INTO tblHours
(TimeCode, Date, Hours, Username, Comments, Approved)
VALUES (@TimeCode,@Date,@Hours,@Username,@Comments,@Approved)
Thanks for any help guys

Last edited: