以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何根据用户名显示其分组? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=187214) |
-- 作者:lin98 -- 发布时间:2023/6/30 14:23:00 -- 如何根据用户名显示其分组? Dim cmd As New SQLCommand Dim dt As DataTable Dim cmb As WinForm.ComboBox = e.Form.Controls("UserName") cmd.C \' cmd.CommandText = "SELEC-T DISTINCT Name From {Users}" dt = cmd.ExecuteReader() For Each dr As DataRow In dt.Datarows cmb.Items.Add(dr("Name")) Next cmb.SelectedIndex = 0 上面代码无法实现,根据用户名,显示其分组?如何解决? |
-- 作者:有点蓝 -- 发布时间:2023/6/30 14:37:00 -- 用户名UserName控件valuechanged事件 Dim cmd As New SQLCommand cmd.C \' cmd.CommandText = "SELECT 部门 From {Users} where name=\'" & e.sender.text & "\'" e.Form.Controls("部门输入框").text = cmd.ExecuteScalar() |