|
-
Sep 26th, 2014, 09:15 AM
#28
Re: Save to database.. Please help
 Originally Posted by Nightwalker83
No, the ID would be the button ID whereas TrayPosition would hold the Record ID. The Record ID is going to be 1 less than the button index because the record set start at -1 where as the button index start at 0.
You have that backwards.
Id = the id of the record
TrayPosition = the index of the button that stores the details
In databases, Ids (primary key) should be unique auto generated values. The application should have nothing to do with the management of them. Ids become important when doing CRUD operations.
In simplest terms, the changes I made were to save the id (record id) in the tag property of the button when loading the tray. This way you always know which record to work on. The I added TrayPosition so you know where to place the seed in the tray when you loading the data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|