我想返回來自類ApplicaitonType的typenames列表,但我收到錯誤 錯誤1實例參數:無法從'System.Linq.IQueryable'轉換爲'System.Collections.Generic.IEnumerable'C :\用戶\ sharaman \文檔\ Visual Studio 2010的\項目\ IssueTracking \ BAL_IssueTracking \ AppQuery.cs 19 17 BAL_IssueTrackinglinq函數返回列表
請提供您的反饋就可以了...太多appericated
公共靜態列表的AppType()
{
List<ApplicationType> m = new List<ApplicationType>();
var context = new Dll_IssueTracking.IssuTrackingEntities();// Object context defined in Dll_IssuTracking DLL
var query = from c in context.ApplicationTypes//Query to find TypeNames
select new { c.TypeName };
//return query.ToList<ApplicationType>();
m = query.ToList<ApplicationType>();//Error here
return m;
}
你有正確的喬恩,您需要使用塊 –
嗨喬恩,其實我需要從ApplicaitonType類返回TypeNames並綁定通過這個功能來DROPDOWNLIST ... – Raman
@Raman:那你爲什麼要聲明你的方法返回'List'?將編輯... –