Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

select 2 tables and include where clause

$
0
0
I have a single SQL Server SELECT search which I search for an Account via a AccountCode (Accounts) and then a user within that Account identified by the resulting AccoutID (UserAccounts)

Code:

Dim Cmd As New SqlCommand("SELECT * FROM AccountUsers LEFT JOIN Accounts ON WHERE Accounts.AccountCode = @AccountCode AND AccountUsers.UserName = @UserName AND AccountUsers.UserPassword = @UserPassword", conn)
This is what I have but there is no ON because I've not searched the code to find the AccountID to then search for a username and password with that AccountID

Is this even possible?

Viewing all articles
Browse latest Browse all 42215

Trending Articles