Thanks Dinesh and Polita for getting back to and helping me out. I'm still finding things a little unclear in regards to this line. I quote
" If you are inserting a single object, then the id of that object is patched up using @@identity/scope_identity. So if you are looking for the id of the inserted object, that is available."
Here is a simplified idea for what I'm trying to achieve...
I have an object called 'Nomination' each 'Nomination' object can have a number of file objects attached to it, so it has a collection of 'File' objects.
Nomination object has NominatedBy, NominationId, and a collection of File objects.
File object has Filename, and NominationId.
The relationship is one to many.
Nomination n = new Nomination();
n.NominatedBy = "Paul Wroe";
Nomination.Insert(n);
File f = new File();
f.NominationId = // here is where I need to tell the file object the Id of the just inserted Nomination
Hope this explains things a little clearer and you can suggest a way to achieve this? or point me towards some documentation.
Kind regards
Paul Wroe