sql server ce - How to get the maximum value from local database in windows phone? -
i need maximum value table should belongs particular category. code follows :
private int gethighscores(int _playmode) { int maxscore = 0; using (hangmanscoredatacontext hangmandb = new hangmanscoredatacontext(@"isostore:/hangmanscoredb.sdf")) { iqueryable<tblehangmanscore> sqlquery = hangmandb._tblehangman; sqlquery = sqlquery.where(p => p.playmode == _playmode); maxscore = sqlquery.asqueryable().max(p => p.score); } return maxscore; }
i getting error
an unhandled exception of type 'system.stackoverflowexception' occurred in unknown module. except maximum value rest of things working . how can solve issue ?
edit : problem arises when table contains 0 numbers of records. same problem when trying minimum value also.
Comments
Post a Comment