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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -