Thursday, May 24, 2012

Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)

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; }   
    }

Friday, May 11, 2012

The data source does not support server-side data paging

You can't use an IQueryable object to data bind to a GridView and still use Paging and Sorting. You must return a List to the GridView using the ToList() method. Thanks

I Built a New Kind of Number Puzzle Game (And You Can Play It Free)

 For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...