我该如何删除此错误。请帮助我...
Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<Linq.Model.usp_DisplayrecordsResult>' to 'System.Data.Linq.Link<Linq.Model.usp_DisplayrecordsResult>' C:\Users\anu\Documents\Visual Studio 2010\Projects\Linq.DAL\DAL.cs 23 24 Linq.DAL
引发错误的方法如下..
Linq.Model.DataAccessDataContext _DataAccessDataContext;
public Link<usp_DisplayrecordsResult> DispPersons()
{
try
{
_DataAccessDataContext = new Linq.Model.DataAccessDataContext();
var query = _DataAccessDataContext.usp_Displayrecords();
List<usp_DisplayrecordsResult> Listresult = new List<usp_DisplayrecordsResult>(query);
return Listresult;
}
catch (Exception ex)
{
throw ex;
}
}
答案 0 :(得分:0)
我认为您不打算将Link
结构用作返回类型。如果将其更改为List
,则会编译:
public List<usp_DisplayrecordsResult> DispPersons()