0
我跟隨本教程由斯科特對我自己的數據庫很大的T。使用自定義SQL查詢與LINQ to SQL ...幫助
我在我的部分類得到一個錯誤。
名稱'ExecuteQuery'在當前上下文中不存在。我不能爲了我的生活找出哪裏出了問題。
public partial class MerchantsAppDataContext
{
public IEnumerable<SubmittalDetails> GetSubmittalDetails(string minDate)
{
var sqlTxt = "SELECT Submittals.SubmittalID, Submittals.Created AS DateFiled, " +
"CheckDetails.Status AS CheckStatus, CheckDetails.CheckNumber, CheckDetails.DateWritten, CheckDetails.FaceAmount, CheckDetails.Reference, CheckDetails.ExhibitNo AS ExhibitNumber, " +
"CheckWriterDetails.FirstName, CheckWriterDetails.LastName " +
"FROM Submittals " +
"INNER JOIN LocationAccepted ON Submittals.LocationAcceptedID = LocationAccepted.LocationAcceptedID " +
"INNER JOIN CheckDetails ON LocationAccepted.LocationAcceptedID = CheckDetails.LocationAcceptedID AND Submittals.SubmittalID = CheckDetails.SubmittalID " +
"INNER JOIN CheckWriterDetails ON CheckDetails.CheckWriterID = CheckWriterDetails.CheckWriterID " +
"WHERE (CheckDetails.DateWritten >= {0})" +
"ORDER BY Submittals.Created DESC, Submittals.SubmittalID, CheckDetails.CheckDetailsID ";
return ExecuteQuery<SubmittalDetails>(sqlTxt, minDate);
}
}
public class SubmittalDetails
{
public int SubmittalID { get; set; }
public string Created { get; set; }
public int LocationAccepted { get; set; }
}
感謝馬克,它解決了它... – JBeckton 2009-11-27 01:01:16