如何将最后插入的值放入组合框中

时间:2015-10-04 14:42:41

标签: vb.net

create table departments
(
   dept_id int identity primary key,
   dept_name nvarchar(40)
)

  dim connection as new sqlconnection()
  dim selectQuery as string = "SELECT * FROM departments"
  dim da as New SqlDataAdapter(selectQuery , connection )
    Dim dt As New DataTable
    da.Fill(dt)
    cmb.DataSource = dt
    cmb.DisplayMember = "dept_name"
    cmb.ValueMember = "dept_id"

在表单中插入新部门后。我想在另一种形式的组合框中获取最后插入的部门值

0 个答案:

没有答案