Basically i am trying to return the ID of the added child record. My current code is....
CounterfeitEntities db = new CounterfeitEntities();
int rowcount = Convert.ToInt32((flx_counterfeitParts[flx_counterfeitParts.SelectedIndex, 0]));
var countpart = db.CounterfeitParts.First(c => c.CounterfeitID == rowcount);
countpart.CounterfeitPartsImages.Add(new CounterfeitPartsImage
{
CountImageComment = txtCommentInput.Text,
CountImageURL = txtImageLinkInput.Text
});
db.SaveChanges();
I have then tried various ways of getting the ID of the added child such as...
string anything = countpart.ChildID
string anything = countpart.CounterfeitPartsImage.ChildID
Any help would be appreciated.
Thanks.

New Topic/Question
Reply



MultiQuote




|