2013-03-14 2 views
0

SQL 테이블이 있으며 SilverLight Linq-to-SQL을 사용하여 행을 삭제하려고합니다. 내가 Linq에 - 투 - SQL에 새로운 오전하지만, SQL 문이SilverLights를 사용하여 데이터베이스에서 한 행을 삭제하는 방법 Linq-to-SQL

DELETE FROM Lloyds_Selection_Vessel WHERE Selection_ID == inpSelectionID AND ImoNumber == inpImoNumber 

Linq의 - 투 - 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(); 
} 

테이블 :

enter image description here

+1

이 읽으십시오 : http://msdn.microsoft.com/en-us/library/bb386925.aspx – Zaki

답변

1

해서는 안 기능을 읽고 당신의 LINQ : 어디에요 (L => l.Selection_ID == & & 리터를 inpSelectionID. ImoNumber == inpImoNumber) 대신에?

관련 문제