コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: haku90/FishKnowApp
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     BackKeyPress += MainPage_BackKeyPress;
     using (HighScoreDataContext context = new HighScoreDataContext(HighScoreDataContext.DBConnectionString))
     {
         if (!context.DatabaseExists())
             context.CreateDatabase();
     }
 }
コード例 #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();
     }
 }