现在,我有这段代码,但它既不工作也不返回错误。
如何获取数据库中的所有记录以将其显示在组合框中?
Private Sub cmbCategory_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbCategory.Click
Dim sqlconn As New SqlClient.SqlConnection
sqlconn.ConnectionString = "server = SKPI-APPS1;" & _
"Database = EOEMS;integrated security=true"
Dim myCommand As New SqlCommand
sqlconn.Open()
myCommand = New SqlCommand("SELECT CAT_ID FROM tblOfficeEquipmentCategory)", sqlconn)
myCommand.ExecuteNonQuery()
sqlconn.Close()
End Sub