Detailsview Updating Problem when being used with an Objectsdatasource , detailsview , objectdatasource , update , problem Belfast, United Kingdom
  • 9 years ago
    Ok so I have a Detailsview below in which I have a list of 7 checkboxes. This is being populated by an Objectdatasource below This is bringing back the object ok and populating the detailsview correctly with the 7 booleans brought back in the object. However I have a problem when I try to update the values in edit mode. When I change a checkbox and hit update it does not keep the changes. I investigated further in case my updatecommand sub procedure was to blame but I dumped out the Parameters and the wrong value is being passed to it. It is passing the SurveyID ok but not passing any new checked checkboxes. Does anybody have an ideas why the detailsview is passing the wrong value as a parameter to the update sub procedure? It seems to pass back false for the checkbox value unless it was set to true originally. What I mean is here is what the Detailsview gets from the Objectdatasource on loading which is correct. False, False, True, True, False, False, False I change the first value checkbox so I would expect the following to be now passed to the update sub True, False, True, True, False, False, False but what I get is the following False, False, True, True, False, False, False same as before. It could be that somthing really simple is to blame but I have tried everything from manually specifying the fields to using template fields. Any thoughts or suggestions would be greatly appreciated. Thanks.
  • 9 years ago
    Ok so I messed up on last post here is the code (hopefully)
  • 9 years ago

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone” - Bjarne Stroustrup