Click here to Skip to main content
15,915,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can edit and delete data from DataGridView control

edit and delete buttons are placed in the datagriview cntol
Posted

 
Share this answer
 
use Table adapter that have Update,Insert,Delete query.
and pass argument as in below example.

yourTableAdapter.Update(yourDataSet.TableName);



Update Button Event
C#
private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                requesterTableAdapter.Update(requesterFileInventoryDataSet.Requester);
                MessageBox.Show("Record Updated", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Some Error in Update", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900