Avatar of somits
somits
 asked on

DetailsView events: ItemUpdated vs ItemUpdating

Hi:

We're creating some web application using VS 2010 with Visual Basic.

We try to update/delete an existing record using DetailsView associated with AccessDataSource

We configure DetailsView to bind with the AccessDataSource and also configure the AccessDataSource for SELECT, INSERT, UPDATE, and DELETE statements.

In DetailsView we check "Enable Inserting", "Enable Editing", "Enable Deleting"

The problem is that when we try to update a record, after updating data in text boxes of DetailsView and clikcing "Update", the record is not updated in both DetailsView and the real database table.  When we try to delete a record, after clicking "Delete", the record is not deleted. It is still there in both DetailsView and gthe real database table.

We  carefully checked the real database table and all the data is still there after each operation.

We looked into the events of DetailsView, we found they have a bunch of them. Among them are "ItemUpdated", "ItemUpdating", "ItemDeleted", "itemDeleting", etc.

Do we - by ourselves - have to implement the sub's associated with these events so that the records could be updated or deleted OR the auto-genererated code by Visual Studio will implement them for us?

Thanks  a lot,

Somits
Visual Basic.NETASP.NETMicrosoft Access

Avatar of undefined
Last Comment
Bob Learned

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
somits

ASKER
Hi:

Thanks for the reply.

To be very simple, if we don't write any code for the event, does visual studio IDE generate code that execute the command?

I read the manual of MSDN, it seems VS does this. However, maybe, I missed something while reading.

Thanks,

Somits
SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
somits

ASKER
Hi:

If I want to check the Connect String, how can I do it?
(If I use OleDb..., then I wrote the conn str by my self. )
Does Vs generates this for us and where it is stored?

Thanks,

Somits
Bob Learned

The connection string is stored in the web.config file.
Your help has saved me hundreds of hours of internet surfing.
fblack61