Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Details view: inserting when in edit mode.

Status
Not open for further replies.

columbo2

Technical User
Jul 14, 2006
97
0
0
GB
Hi,

I have a detailsview that shows the details of a record.
The person viewing the page can update the details.
When they click update the record on screen inserts to a different table (to protect the original table) rather than updating.

I did this by automatically putting the detailsview into edit mode, hiding the cancel/update buttons and adding a button link that sets off the Insert method of the datasource that is bound to the detailsview.

The only trouble is that I am just getting NULLs inserted into the table.

My theory is that because the detailsview is in edit mode it is in some way ignoring the insert parameters.

Can any one confirm this or suggest any other reason?

I suspect that I am deviating to far off what the DetailsView is designed for and that as a consequence I am running into issues that are taking more time up than is being saved by using the details view.

Thanks
C
 
When they click update the record on screen inserts to a different table (to protect the original table) rather than updating.
That's a rather odd approach. Why not just create a trigger on the main table to write the previous values out to a history table? That way, you don't have to change any application code and it protects your data if any other programs ever write to the table.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
I see what you're saying and that is a good idea but having thought about it I can't because I don't want this page to have anything other than SELECT access to this database (it's a public facing page). Also all the updates are checked by somebody before they are added to the main site (which feeds off this database)to avoid rubbish getting onto the site.
If this person is off or sick for a week or something we'd have bad data in the database.

You have got me thinking about making a copy of the records that are going to be updated and use entirely that table...in fact I might do that to make it even more secure.

yes i'm going to do that
actually no I can't because the records will go out of date.

Thanks for getting me thinking
ta
C



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top