Here's the next instalment of my asp.net data access nightmare!
I've got a listview on my page, and when I run the page it correctly displays the data that it should. However, when I add data into the empty new record and hit the 'Insert' button the page posts back but the record isn't inserted. Annoyingly, I don't get any error!
The listview's datasource has an INSERT command and insert parameters specified. The button seems to be triggering the listview's insert method because the ItemInserting event fires.
With no error message to go on I'm struggling to figure out what the problem is. I have a feeling it's something to do with the makeup of the page. The listview in question is nested within an Accordion control and the listview's data source isn't set until runtime, when it's done in the ItemDataBound event of the Accordion control. As I say, though, it does RETRIEVE data correctly, it's just the inserting that's a problem.
I created a new, blank page with just this listview on it using the same code but not nesting it within any other control and hardcoding the datasource instead of setting it at runtime and that works perfectly, so I'm confident that my INSERT command, insert parameters and so forth are correct.
View Complete Post