im cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
Dim cmb As WinForm.ComboBox = e.Form.Controls("ComboBox1")
cmd.C onnection Name = "Lucifer"
cmd.CommandText = "SELECT * Fro m {用户表} order by 登陆时间 Desc"
dt = cmd.ExecuteReader()
For Each dr In dt.Datarows
cmb.Items.Add(dr("用户名称"))
Next
cmb.SelectedIndex = 0
Dim cmb2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim dt2 As DataTable=DataTables("账套管理")
Dim dr2 As DataRow
For Each dr2 In dt2.DataRows
cmb2.Items.Add(dr2("数据源名称"))
Next
For i As Integer = 0 To cmb2.Items.Count - 1
If cmb2.Items(i) = dt.DataRows(0)("登陆账套") Then
cmb2.SelectedIndex = i
Else
cmb2.SelectedValue="默认账套"
End If
Next