I got this when i use linq query
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}
query is below
public IQueryable<GasUtilGas> LoadAllForkliftGasUtilByDetailId(int id)
{
var res = from gu in db.tblForlkliftGasUtils
join g in db.tblGas on gu.GasID equals g.GasID
select new GasUtilGas { GasNo = g.GasNumber};
return res;
}
It seems like g.GasNumber is a nullable int field in the database. Change the model to this:
public class GasUtilGas
{
public int? GasNo { get; set; }
}