How can i Remove this error. pls Help me in this...
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
method in which error raised is as follows..
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;
}
}
I don't think that you intended to use the Link
structure as return type. If you change that to List
it will compile:
public List<usp_DisplayrecordsResult> DispPersons()
精彩评论