dbTalk Databases Forums  

DB4o - Can't delete object stored in global variable

comp.databases.object comp.databases.object


Discuss DB4o - Can't delete object stored in global variable in the comp.databases.object forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bryan
 
Posts: n/a

Default DB4o - Can't delete object stored in global variable - 04-07-2006 , 06:35 PM






I have a class Human. A form lists all humans. When the user double
clicks on a human, I open another form showing the details of that
human.
There is a global variable on the detail form called CurrentHuman of
type human. When the user double clicks a human in the list on the
first form, I do a search to find the object and set the global
variable 'CurrentHuman' = to this object.
Now when I am in the detail form I have a button that deletes the
object 'CurrentHuman' but it is not working. Here is some of my code:

This finds the object that the user double cliked on by searching for
the unique ID property (EntityID is the ID value of the human that was
double clicked). The object found here is sent to the 'CurrentHuman'
global variable on the detail form
Dim results As ObjectSet = db.Get(GetType(Human))
For Each h As Human In results
If h.ID = EntityID Then
Return h
Exit Function
End If
Next

Here is what I have to delete the human object
db.Delete(CurrentHuman)

This is not working however, what could be going wrong?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.