0
这很奇怪,我有一个网格工作,并显示它需要什么,两个不是,他们都写同样的方式。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
以及不两个代码:
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
我在做什么错,工程
码?