المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How would i get the current Index ID of the currently displayed record



C# Programming
02-06-2010, 03:40 PM
Trying to make an update function for lets say apples
Apple Table contains color and size and ID

lets say i have 10 apples
and i navigate to apple 5, how can i determine what its ID is ?

Basically the bindingnavigator would say 5 of 10 but what if I seeded my identity column starting with 200
obviously simply id = applebindingsource.position +1 will not work...

I thought maybe making a
Listtempapple = null;
tempapple = db.apple.tolist();
currentapple id = tempapple[applebindingsource.position + 1].ID;


but that doesn't appear to work either cause it's out of range

any help on this would be great...