非常に奇妙です。グリッドが1つあり、必要なものを示しています.2つではありません。同じように書かれています。作品DataGridViewにデータが表示されないVB.NET
コード:
Private Sub Form2_Shown(sender As Object, e As EventArgs) Handles Me.Shown
access.ExecQuery("SELECT emotion1,emotion2,emotion3,emotion4,emotion5, " & _
"situation1,situation2,situation3, " & _
"physical1,physical2,physical3,physical4,physical5 " & _
"FROM emotionlogdb ORDER BY id DESC;")
If Not String.IsNullOrEmpty(access.exception) Then
MsgBox(access.exception) : Exit Sub
End If
DataGridView1.DataSource = access.DBDT
End Sub
とそうでない2つのコード:
Private Sub Form5_Shown(sender As Object, e As EventArgs) Handles Me.Shown
access.ExecQuery("SELECT journal FROM journalDB ORDER BY id DESC")
If Not String.IsNullOrEmpty(access.exception) Then
MsgBox(access.exception) : Exit Sub
End If
DataGridView1.DataSource = access.DBDT
End Sub
そして:
Private Sub Form6_Shown(sender As Object, e As EventArgs) Handles MyBase.Load
Dim sit As Integer = Alg.sitMode
Dim em As Integer = Alg.emMode
Access.ExecQuery("SELECT EmPlusSitMemo FROM TrendsDB WHERE EmotionID1= " & em & "AND SitID1= " & sit & ";")
If Not String.IsNullOrEmpty(Access.exception) Then
MsgBox(Access.exception) : Exit Sub
End If
DataGridView1.DataSource = Access.DBDT
End Sub
私が間違って何をしているのですか?
access.ExecQuery("SELECT journal FROM journalDB ORDER BY id DESC")
と
Access.ExecQuery("SELECT EmPlusSitMemo FROM TrendsDB WHERE EmotionID1= " & em & "AND SitID1= " & sit & ";")
、その後、デバッグモードでプロジェクトを実行します。あなたがしようとする必要がどのような