已解决,效果非常好。谢谢各位的关注!愿与大家分享。
Dim MyConnection As New System.Data.OleDb.OleDbConnection(MySQLConnectionString)
MyConnection.Open()
Dim MySQL As String = "select distinct 主题 from 日记 ORDER BY 主题 DESC"
Dim MyAdapter As New OleDbDataAdapter(MySQL, MyConnection)
Dim MyDepartmentTable As New System.Data.DataTable()
MyAdapter.Fill(MyDepartmentTable)
Dim dr As DataRow = MyDepartmentTable.NewRow()
dr("主题") = "(全选)"
MyDepartmentTable.Rows.InsertAt(dr, 0)
Me.主题ComboBox1.DataSource = MyDepartmentTable
Me.主题ComboBox1.DisplayMember = "主题"
Me.主题ComboBox1.ValueMember = "主题"
If (MyConnection.State = ConnectionState.Open) Then
MyConnection.Close()
End If