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"
在表单中插入新部门后。我想在另一种形式的组合框中获取最后插入的部门值