Radgrid not updating database

If you use timestamps, tje object you want to delete needs the PK set and the Row Version Property in order to update it successfully!I was setting the row Version (timestamp) property, after I have attached the object to the respective Db Set, that's why it didn't work. I ran into this and it was caused by the entity's ID (key) field not being set.Thus when the context went to save the data, it could not find an ID = 0.Be sure to place a break point in your update statement and verify that the entity's ID has been set.Luckily in may case the trigger functionality was incorrect, but I guess it could be a valid operation that should somehow be handled in code. To expand on the comment by @jahu, I had to get an actual id of the newly inserted item to be returned from my trigger and the column name has to match the trigger table's identity column (in my case, actually a view so it didn't have an identity of its own but I had tricked the edmx into believing it did).My trigger was doing an insert into a separate table, so I just added this last line to my trigger: In my case I was doing a delete operation on entities in a child collection but there was a trigger on delete for one of the child entities that caused another of the child entities to be deleted.At the time you are saving the object to db, you need the previous value of the Row Version submit to the db along with the object for the concurrency check.You make silly mistakes when you need things faster!

For me the issue was I didn't have the sql table setup correctly.

One way to debug this problem in an Sql Server environment is to use the Sql Profiler included with your copy of Sql Server, or if using the Express version get a copy of Express Profiler for free off from Code Plex by the following the link below: Express Profiler By using Sql Profiler you can get access to whatever is being sent by EF to the DB.

In my case this amounted to: exec sp_executesql N'UPDATE [dbo].[Category] SET [Parent ID] = @0, [1048] = NULL, [1033] = @1, [Member ID] = @2, [Added On] = @3 WHERE ([Category ID] = @4) ', N'@0 uniqueidentifier,@1 nvarchar(50),@2 uniqueidentifier,@3 datetime2(7),@4 uniqueidentifier', @0='E060F2CA-433A-46A7-86BD-80CD165F5023',@1=N'I-Like-Noodles-Do-You',@2='EEDF2C83-2123-4B1C-BF8D-BE2D2FA26D09', @3='2014-01-29 .0435565',@4='3410FD1E-1C76-4D71-B08E-73849838F778' go I copy pasted this into a query window in Sql Server and executed it.

Sure enough, although it ran, 0 records were affected by this query hence the error being returned by EF.

In my case the problem was caused by the Category ID.

Leave a Reply

  1. the big bang theory 07x03 online dating 01-Jan-2018 09:56

    Also draw attention to bonuses that give access to many XXX pay sites in different niches.

  2. dating guelph 20-Aug-2017 09:59

    Syvkabale handler kort og godt om at samle sine spillekort i fire tomme felter, der kaldes fundament-stakke.

  3. schott s miscellany online dating 29-Dec-2017 20:37

    As humans societies have evolved from hunter-gatherers into civilized societies, there have been substantial changes in relations between men and women, with perhaps one of a few remaining biological constants being that both adult women and men must have sexual intercourse for human procreation to happen.

  4. Alt sex dating sites 19-Jul-2017 00:48

    At this time it is not known who penned it or why, but the exchange is fiction.

  5. Casual dating app kostenlos 25-Sep-2017 02:39

    It will also connects you with people who can understand and share the same biker lifestyle as yours.