开发者

Need help inresilving the bug

开发者 https://www.devze.com 2023-03-27 00:09 出处:网络
How can i Remove this error. pls Help me in this... Error1Cannot implicitly convert type \'System.Collections.Generic.List<Linq.Model.usp_DisplayrecordsResult>\' to \'System.Data.Linq.Link<L

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()
0

精彩评论

暂无评论...
验证码 换一张
取 消