Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
615
LinqDataSource doesn't update or delete?
posted

Hi,

I finally got to playing around a bit with Linq today. I'm using VS2008 (offcourse) and NetAdvantage for ASP.NET 2007 vol 3. For some reason I can't get the ultrawebgrid to update or delete records in the database. The insert statement seems to work fine though.

Here's what I did:
- I placed a ultrawebgrid on a new aspx form and chose the LinqDataSource as my data source.
- I connected the LinqDataSource to the correct object in my data layer and enabled insert/update/delete features on it

The data was displayed correctly, but at first all newly added rows in the grid weren't sent to the database. I noticed no postback (I use an AJAX enabled grid) was issued for new rows. By adding an event handler for the 'UpdateRow' event I was able to trigger a postback (though the event handler itself was empty) and correctly insert a new record into the database.

So far so good, but unfortunately the same trick didn't apply to updating and deleting records. A postback is issued and I can effectively add breakpoints to the UpdateRow and DeleteRow events of the grid, but these updates arent sent to the datasource. I tried adding event handlers for the Updating and Deleting events the DataSource has, but those events aren't fired at all. I also tried calling UpdateDBRow and DeleteDBRow for the correct row passed to the event handlers, but that doesn't do the trick either.

Is there something I'm overlooking? Any help would be appreciated, thanks!

Parents
  • 1171
    posted

    I'd recommend turning off ajax and trying to get the updates working in regular postback mode. Exceptions that are thrown during updates tend to get swallowed by ajax mode unless you are explicitly looking for them.

    Also try hooking your data source up to a MS DataView to make sure there's no problems with the linq data source itself. 

    It's possible that the linq scenario that you're trying isn't supported in 7.3. Support for VS2008 features is something that's being worked on for the 8.1 release. If you find you are running into problems, I'd recommend letting developer support know. They'll be able to pass it on to the development team as a bug to make sure that it works in the new version. 

Reply Children