Hi Guys,

I have a dgv and I want to be able to add,edit and delete. I've got my code for updating to work. I grab the Id from colum1 of the row to update and write my updatecommand accordingly.

On the currentcellchange event I am grabbing the Id.

But when I am adding a new row this event is fired and bcos there is no Id in there an error is trigerred. How can I fix this. On which event should I grab the Id