我有一个 SQL 表,我想使用 SilverLight Linq-to-SQL 删除一行。我是 Linq-to-SQL 的新手,但 SQL 语句应该是
DELETE FROM Lloyds_Selection_Vessel WHERE Selection_ID == inpSelectionID AND ImoNumber == inpImoNumber
什么是 Linq-to-SQL 语句?这是我的代码:
[OperationContract]
void DeleteSelectionVesselRow(int inpSelectionID, int inpImoNumber)
{
PositionDataClassesDataContext context = new PositionDataClassesDataContext();
context.Lloyds_Selection_Vessels.DeleteAllOnSubmit(context.Lloyds_Selection_Vessels.Where(l => l.Selection_ID == inpSelectionID && x => x.ImoNumber == inpImoNumber));
context.SubmitChanges();
}
桌子: