public IList<HighScore> GetAllhs()
 {
     IList<HighScore> list = null;
     using (HighScoreDataContext context = new HighScoreDataContext(HighScoreDataContext.DBConnectionString))
     {
         IQueryable<HighScore> query = from c in context.HighScores select c;
         list = query.ToList();
     }
     return list;
 }
Esempio n. 2
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     BackKeyPress += MainPage_BackKeyPress;
     using (HighScoreDataContext context = new HighScoreDataContext(HighScoreDataContext.DBConnectionString))
     {
         if (!context.DatabaseExists())
             context.CreateDatabase();
     }
 }
Esempio n. 3
0
 public void Addhs(string name,string score)
 {
     using (HighScoreDataContext context = new HighScoreDataContext(HighScoreDataContext.DBConnectionString))
     {
         HighScore hs = new HighScore();
         hs.NameFish = name;
         hs.Score = score;
         hs.ID = HigScoreIn.cnt++;
         hs.Date = DateTime.Now;
         context.HighScores.InsertOnSubmit(hs);
         context.SubmitChanges();
     }
 }