1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Public Function GetUserlistByName(ByVal name As String) As List(Of String())
Dim usernames As New List(Of String())
ConnectDB()
sql = "select firstname, lastname, username from usermanagement.fn_get_userlist_by_name('" & name & "','" & frmStart.current_User1.Store & "') order by lastname"
'sql = "select firstname, lastname, username from UserManagement.Users where lastname like '%" & name & "%' and shop = '" & frmStart.current_User1.Store & "' order by lastname"
ds = Cnx.DoSelect(sql)
If ds.Tables.Count > 0 Then
For Each row As DataRow In ds.Tables(0).Rows
Dim userinfo As String() = {"", ""}
userinfo(0) = CStr(row("lastname")) & " " & CStr(row("firstname"))
userinfo(1) = CStr(row("username"))
usernames.Add(userinfo)
Next
End If
Return usernames
End Function |
Partager