私は学校の VB プロジェクトに取り組んでいます。これはスネーク ゲームで、ハイスコアをデータベースに保存しています。古い低スコアを取り除き、新しい高スコアを挿入できるように、データセットからレコードを挿入および削除する方法を知る必要があります。私のクラスでは LINQ について非常に簡単に説明しただけなので、私はほとんど無知です。
これは私がこれまで持っているものであり、すべて機能します。
Private Sub HighScores_Load(sender As System.Object, e As System.EventArgs)
Handles MyBase.Load
'See if player score is higher than the low score, and if so, add player name and score to database
Me.HighscoresTableAdapter.Fill(Me.VbprojectDataSet.highscores)
Dim lowScore = Aggregate scores In VbprojectDataSet.highscores
Select scores.score
Into Min()
If GridForm.player.score > lowScore Then
Dim lowScoreRow = From scores In VbprojectDataSet.highscores
Where scores.score = lowScore
Select scores
GridForm.player.name = InputBox("You got a new high score! What is your name?", "SnakE")
End If
End Sub