Datagridview updating database c

Does anyone have suggestions for getting these, or some other event working for my purposes?The two inelegant alternatives I'm weighing are a) stringing together some labels/textboxes and an add button or b) using the Data Grid Cell_Value Changed event, by having some nested try/catch that will try to insert first, then if it fails try to update, and then do nothing if the update doesn't work. I use this event because it allows for a whole row to be entered / edited before trying to save the changes.I know there has to be some event for what I'm trying to and I just can't figure it out.I tried the Leaving Row event, but the problem with that is that the final value hasn't updated when this event triggers.I use this code on the delete button, but it doesn't remove permanently the selected rows. But I want to do it using Datagrid View I already bind it to my database.cmd = new Ole Db Command("insert into FWINFOS (ID, Name, Gender, Date Of Birth, Race, Working Place, Passport NO, Date Of Expire,[Position], Photo) values('" text Box5. Fill(table); Binding Source b Source = new Binding Source(); b Source.

They enter info in the last column, then push down to enter a new row.

In the preceding code, I created a data Grid View1_Row Header Mouse Click Event for updating and deleting the selected record.

When the user clicks on the Row Header of a row then the data present in the cell of the row is stored into the Text Boxes.

They have to do with redrawing the control which is why new rows don't appear.

Close(); if (n are methods that are inherited from Control.


Leave a Reply