Connecting Tech Pros Worldwide Help | Site Map

To delete a row in access table from datagridView using ContextMenuStrip

Newbie
 
Join Date: Jan 2009
Posts: 4
#1: Jan 24 '09
hi..
how to delete the selected row in datagridview using ContextMenuStrip.When i right-click and press "delete" the seleted row in the dataGridView has to be deleted and as well in my access table.I am new to C#.net

my coding is this:
Expand|Select|Wrap|Line Numbers
  1.             int curRow = 0;
  2.             curRow = this.dataGridView1.CurrentRow.Index;
  3.             this.dataGridView1.Rows.RemoveAt(curRow);
  4.  
but it is deleting only in datagridView and it is not getting updated in my access table.plz help me with the code,where i should write my query to delete based on the selected row .plz help me
Newbie
 
Join Date: Mar 2009
Posts: 1
#2: Mar 18 '09

re: To delete a row in access table from datagridView using ContextMenuStrip


Hi there !
I got the same problem check out this:
# int curRow = 0;
# curRow = this.dataGridView1.CurrentRow.Index;
# this.dataGridView1.Rows.RemoveAt(curRow);
->this.tableAdapterManager.UpdateAll(this.YourDataS et);<-
Reply