views:

45

answers:

1

hiya

when deleteing this works:

orderitems.Delete(x => x.orderitem_sessionid == transkey);

however this does not work

orderitem.Delete(x => x.orderitem_sessionid == transkey 
                       && x.orderitem_productid == 6);

i get no errors, but nothing is deleted either, i have working code as a substitute of

var DeleteableItems = orderitems.All().where(x => x.orderitem_sessionid == transkey 
                                             && x.orderitem_productid = 6);

foreach(var item in DeleteableItems) item.delete;

though the above works it still bugs me that this wont work with just nomal delete method, using subsonic 3.0.0.3 and mysql database

thanks

+1  A: 
Daniel Elliott
yes sorry the mistake of extra = was a typo when writing out the postanother developer had the problem on his machine, i gave hime the solution as i could not understand why it would not delete, plus time is key ya know.is there some way i can output the sql that was sent, so i check how it is translated and then take it from there....thanks
minus4
If SQL Server is the backend, open SQL Profiler from the tools menu of the Management Studio and set up a new trace. Profile the bits you want and check what queries are being fired at your DB. I find writing a unit test I can set a debug point in quite useful. Clear the log then let the unit test go. Your SQL is at the top.
Daniel Elliott