Heya guys, this is my first post - this forum has been loads of help in the past :)
Anyway, I am currently coding a program that requests a user's Log In name and password, and then (via a SQL query) checks it against a record in the database, and returns the Member Number. The only thing is that I'm not sure how to return the Member Number into a variable. Here's what I have so far:
sqlcon.Open()
Dim username As String = UsernameTextbox.Text
Dim password As String = PasswordTextbox.Text
Dim memnumber as integer
Dim DataCommand As New SqlCeCommand
DataCommand = sqlcon.CreateCommand
DataCommand.CommandText = "SELECT MemberNumber FROM MembersProgramDetails WHERE Username =" & username & "AND Password =" & password
'RETURN VALUE OF MEMBER NUMBER TO (memnumber)
Any help is greatly appreciated,
Ryan.