查詢模式實現缺失:解決“無法找到”錯誤
解決問題來驗證該類型的質量是至關重要的。在此特定實例中,tblpersoon可能需要以下修改:
var query =(來自tblpersoon.cast.cast.castPossible Causes
Apart from the absence of appropriate implementation, there are certain other potential causes for this error:var query = (from p in tblPersoon.CastMissing LINQ Namespace Usage:() select p).Single();
Make certain that the System.Linq namespace is properly incorporated using the following聲明:
使用System.linq;indroper查詢目標:
驗證您正在查詢正確的類型(考慮:在提供的示例中,通過ID的“ tblperson”對象的檢索需要dataclasses1datacontext類的實例,該類別揭示了tblpersoons屬性。因此,修訂的代碼類似於以下內容:
public tblpersoon getPersonById(字符串ID) { var context = new dataclasses1datacontext(); var query = context.tblpersoons.where(p => p.id == id).single(); // ... }免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3