-1

Label.text ="ad"データベースに「広告」があり、すべてを表示すべきではない人だけを表示したい場合、コンボボックスの表示をフィルタリングするにはどうすればよいですか。しかし、エラー無効な引数 = '0' の値は、SelectedIndex' パラメータ名:Selectedindex には有効ではありません。

Private Sub FillCombo()
   Try
       conn = New OleDbConnection(Get_Constring)

       Dim sSQL As String = ("SELECT subject FROM student where subject like'" & Label25.Text & "%' ")
       Dim da As New OleDbDataAdapter(sSQL, conn)

       Dim ds As New DataSet
       da.Fill(ds)

       cmbsection.ValueMember = "subject"
       cmbsection.DataSource = ds.Tables(0)
       cmbsection.SelectedIndex = 0

   Catch ex As Exception
       MsgBox("ERROR : " & ex.Message.ToString)
   End Try
End Sub
4

1 に答える 1