Hi @Muana Ralte ,
It seems that you have retrieved a table from Access and display it on DataGridView.
What do i do if i only want to display Class I
Basically, you can refer to the following code.
Using cnn As OleDbConnection = New OleDbConnection(connstring)
Dim cmd As New OleDb.OleDbCommand()
cmd.Connection = cnn
cmd.CommandText = "SELECT * FROM yourTable WHERE Class = @class"
cmd.Parameters.AddWithValue("@class", "Class I")
cnn.Open()
Dim da As New OleDb.OleDbDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
Me.DataGridView1.DataSource = dt
End Using
Besides, if I have any misunderstanding, please provide more details or related code here. It will help us make a test.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.