database - DELETE VALIDATION for DataGridView -


i wan't delete button.
@ first code success. can delete both data's vb program data of database located @ ms access.

but, when added validations delete button, adding messageboxstyle , messageboxbutton won't work. deletes entry of textboxes not data itself.

my question be...

i wan't program not delete data on textboxes data corresponds on datagridview when press "yes" on confirmation message. , when click on no button it'll remain is. how do this???

please me. i'm new , still learning. i'm still student , need system... thank you!

here code!

imports system.data.oledb

imports system.text.regularexpressions

public class monitoring_form

dim connect oledbconnection dim adapter oledbdataadapter dim commnd oledbcommand dim dataset dataset dim datatable datatable dim table datatablecollection dim binding new bindingsource dim id integer dim email boolean   private sub btn_cdelete_click(sender system.object, e system.eventargs) handles btn_cdelete.click     txt_customerid.text = id         if messagebox.show("are sure wan't delete record?", "delete confirmation", messageboxbuttons.yesno, messageboxicon.warning) = windows.forms.dialogresult.yes          commnd = new oledbcommand("delete  customersinfo firstname = '" + txt_firstname.text + "'", connect)         commnd.executenonquery()         msgbox("entry deleted!")          txt_customerid.text = ""         txt_firstname.text = ""         txt_lastname.text = ""         txt_add.text = ""         txt_cnumber.text = ""         txt_email.text = ""          '' me.dgv_1.rows.removeat(me.dgv_1.currentrow.tostring())            else      end if       end sub 

i've edited question make clear guys. please , sorry mistake.

this revision of code


Comments