用于将数据库中的数据字段填充到组合框中的代码 [英] code to fill a data field from database into in combobox

查看:74
本文介绍了用于将数据库中的数据字段填充到组合框中的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Dim str As String

        str = "Select Datee From Schedules Where BusID = '" + ComboBox1.SelectedValue + "' "
        con.Open()

    End Sub







i从combobo中选择busid的值x1和我希望更改应该反映在combobox2

根据我选择的busid




i am selecting value of busid from combobox1 and i want that changes should reflect in combobox2
according to busid i selected

推荐答案

这将向您展示如何查询数据库,



http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/e4344a25-93e5-40d4-a97d-c5ee0b573577/ [ ^ ]



这将告诉你如何将结果绑定到你的组合框,



http://vb.net-informations.com/dataset/bind-combobox.htm [ ^ ]
This will show you how to query the database,

http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/e4344a25-93e5-40d4-a97d-c5ee0b573577/[^]

And this will show you how to bind the results to your combo box,

http://vb.net-informations.com/dataset/bind-combobox.htm[^]


这篇关于用于将数据库中的数据字段填充到组合框中的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆