Aidin
چهارشنبه 08 آبان 1387, 17:57 عصر
سلام
من یه SP دارم و خروجی اون را می خوام به یه Type تبدیل کنم
با یه تابع تو DAL این کارو انجام میدم :
public IQueryable<TypeTimeEvent> GetTime4Chart(string IP, string PC, string User)
{
SINADataClassesDataContext MyDB = new SINADataClassesDataContext();
var Q = (
from p in MyDB.Chart_Get24Hour(IP, PC, User)
select new TypeTimeEvent() { ID = Convert.ToInt32(p.ID), SumDur = Convert.ToInt32(p.SumDur), SumDurS = p.SumDurS, Hour = p.Hour });
return Q;
}ولی این Error رو میگیره :
Error 5 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<SINA_Web_Interface.TypeTimeEvent>' to 'System.Linq.IQueryable<SINA_Web_Interface.TypeTimeEvent>'. An explicit conversion exists (are you missing a cast?)
من یه SP دارم و خروجی اون را می خوام به یه Type تبدیل کنم
با یه تابع تو DAL این کارو انجام میدم :
public IQueryable<TypeTimeEvent> GetTime4Chart(string IP, string PC, string User)
{
SINADataClassesDataContext MyDB = new SINADataClassesDataContext();
var Q = (
from p in MyDB.Chart_Get24Hour(IP, PC, User)
select new TypeTimeEvent() { ID = Convert.ToInt32(p.ID), SumDur = Convert.ToInt32(p.SumDur), SumDurS = p.SumDurS, Hour = p.Hour });
return Q;
}ولی این Error رو میگیره :
Error 5 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<SINA_Web_Interface.TypeTimeEvent>' to 'System.Linq.IQueryable<SINA_Web_Interface.TypeTimeEvent>'. An explicit conversion exists (are you missing a cast?)