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!