如何将ComboBox与数据库值链接

时间:2017-03-12 11:56:49

标签: mysql vb.net

如何将ComboBox与数据库值相关联?尝试以下代码时收到错误消息:

Dim READER As MySqlDataReader
Try
    tilkobling.Open()
    Dim Query As String
    Query = "select * from g_oops_22.minsideNy"
    Command = New MySqlCommand(Query, tilkobling)
    READER = Command.ExecuteReader

    While READER.Read
        Dim blodLokasjon = READER.GetString("blodgivninglokasjon")
        ComboBox1.Items.Add(blodLokasjon)
    End While

    tilkobling.Close()

0 个答案:

没有答案