views:

54

answers:

1

I've had problems with the update method in subsonic, so instead of using:

a.Update()

I used

var qry = dbAnimals.Update<Notification>().
                Set(n => n.NotName == notification.NotName).
                Set(n => n.NotRecStatus == notification.NotRecStatus).
                Set(n => n.NotModified == notification.NotModified).
                Where(n => n.NotRecID == id).Execute(); 

The thing is that I now want to delete, and I get the same nullreference exception. so

a.Delete()

does not work. What would be the equivalent to delete that row depending on its ID? I have tried to find it but didn't get a clue.

Thank you:

+1  A: 

To solve this problem I finally used this:

var query = new SubSonic.Query.Delete<Notification>(dbAnimals.DataProvider).
                From<Notification>().
                Where(NotificationTable.NotRecIDColumn).IsEqualTo(id).
                Execute();
vikitor