如何将显示成员显示到组合框?

时间:2014-04-15 20:23:54

标签: vb.net datagridview combobox

抱歉,我再次提出同样的问题。但我需要解决这个问题。 我有sql表有2列SerciveIDServiceName,IN sql数据库我存储为 id。我想点击datagridview组合框将显示名称。

Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick

i = DataGridView1.CurrentRow.Index 
    Me.TextBoxid.Text = DataGridView1.Item(0, i).Value.ToString
    Me.TextBoxName.Text = DataGridView1.Item(1, i).Value.ToString
    Me.TextBoxSex.Text = DataGridView1.Item(3, i).Value.ToString
    Me.TextBoxAge.Text = DataGridView1.Item(2, i).Value.ToString
    Me.TextBoxAddress.Text = DataGridView1.Item(4, i).Value.ToString
    Me.TextBoxCHiN.Text = DataGridView1.Item(5, i).Value.ToString
    Me.TextBoxCHinL.Text = DataGridView1.Item(6, i).Value.ToString 


    Me.ComboboxService.DisplayMember = DataGridView1.Item(7, i).Value.ToString



    Me.TextBoxCHout.Text = DataGridView1.Item(9, i).Value.ToString
    Me.TextBoxCHoutL.Text = DataGridView1.Item(8, i).Value.ToString
    Me.TextBoxTransfer.Text = DataGridView1.Item(10, i).Value.ToString
    Me.ComboBoxPtr.Text = DataGridView1.Item(11, i).Value.ToString

它没有错误,但在ComboboxService中不起作用

0 个答案:

没有答案