By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

update the database

P: n/a
hi, all

Two question:

1. When a row is deleted or added (or in other words when there is change)
in the datagrid, Is this change actually the change in the underlying
dataset ?

2. which event of datagrid control is fired when a row is deleted or added,
so that i can create the commandbuilder and use dataadapter.update in that
event. Is there any other method to update the changes.

TIA
Irfan


Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Irfan,
1. When a row is deleted or added (or in other words when there is change)
in the datagrid, Is this change actually the change in the underlying
dataset ?
That happens when the user changes from row on the datagrid or when you
execute a endcurrentedid with the buildingcontext.

2. which event of datagrid control is fired when a row is deleted or
added, so that i can create the commandbuilder and use dataadapter.update
in that event. Is there any other method to update the changes.

The commandbuilder builds an update, delete, and insert command accoording
to the select command. (When it is a not to difficult select command)

Changes in a datatarow are kept in the datarow rowstate. Updates, deletes
and inserts are by the dataadapter done accoording to those rowstates.

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
thanks Cor for the reply, however i need to catch the event when a row is
deleted and in that event i want to write oledbAdapter.update
which event is that ?

irfan
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Irfan,
1. When a row is deleted or added (or in other words when there is
change) in the datagrid, Is this change actually the change in the
underlying dataset ?


That happens when the user changes from row on the datagrid or when you
execute a endcurrentedid with the buildingcontext.

2. which event of datagrid control is fired when a row is deleted or
added, so that i can create the commandbuilder and use dataadapter.update
in that event. Is there any other method to update the changes.

The commandbuilder builds an update, delete, and insert command accoording
to the select command. (When it is a not to difficult select command)

Changes in a datatarow are kept in the datarow rowstate. Updates, deletes
and inserts are by the dataadapter done accoording to those rowstates.

I hope this helps,

Cor

Nov 21 '05 #3

P: n/a
Irfan,
thanks Cor for the reply, however i need to catch the event when a row is
deleted and in that event i want to write oledbAdapter.update
which event is that ?

That I don't know

Cor
Nov 21 '05 #4

P: n/a
That event is the update button that will execute the update.

Private Sub btnUpdate_Click(ByVal sender As System.Object, e As
System.EventArgs) Handles btnUpdate.Click

If DsVendors1.HasChanges then
OleDbDataAdapter1.Update(DsVendors1)
End If

End sub

This is what i have when i added a record to the MSAccess database and
clicked the update button to update the added information.
"Irfan" wrote:
thanks Cor for the reply, however i need to catch the event when a row is
deleted and in that event i want to write oledbAdapter.update
which event is that ?

irfan
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Irfan,
1. When a row is deleted or added (or in other words when there is
change) in the datagrid, Is this change actually the change in the
underlying dataset ?


That happens when the user changes from row on the datagrid or when you
execute a endcurrentedid with the buildingcontext.

2. which event of datagrid control is fired when a row is deleted or
added, so that i can create the commandbuilder and use dataadapter.update
in that event. Is there any other method to update the changes.

The commandbuilder builds an update, delete, and insert command accoording
to the select command. (When it is a not to difficult select command)

Changes in a datatarow are kept in the datarow rowstate. Updates, deletes
and inserts are by the dataadapter done accoording to those rowstates.

I hope this helps,

Cor


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.