Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 使用组合框文本作为绑定源的一部分_Vb.net - Fatal编程技术网

Vb.net 使用组合框文本作为绑定源的一部分

Vb.net 使用组合框文本作为绑定源的一部分,vb.net,Vb.net,您好,我正在尝试使用包含多个数据库的组合框在网格视图中显示数据。每个数据库都有一个绑定源。但是,有没有一种方法可以代替编写一个巨大的select语句,我可以使用TableList.SelectedText并将其放在BindingSource前面,这样我就不必编写这么多实例了 我试着在下面做,但不起作用 Private Sub TableList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TableList.Sel

您好,我正在尝试使用包含多个数据库的组合框在网格视图中显示数据。每个数据库都有一个绑定源。但是,有没有一种方法可以代替编写一个巨大的select语句,我可以使用TableList.SelectedText并将其放在BindingSource前面,这样我就不必编写这么多实例了

我试着在下面做,但不起作用

Private Sub TableList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TableList.SelectedIndexChanged
        DataGridView1.DataSource = TableList.SelectedText(BindingSource)
        DataGridView1.AutoGenerateColumns = True

SelectedText
不是您可能认为的那样。请阅读并获取我想要使用的.SelectedText或.Text,用于组合框中选择的任何内容,以便它可以与绑定源啮合以创建正确的路径。