You'll have to query the db to find out if the card number and pin matches. Psuedo code will be something like this: Setup your connection object Setup your command object(if you have a stored procedure, setup your parameters..card number, pin number) OR Set the SQL Text of your command object execute the command object. You can either return a value for your command object or check to see if any records exist in your returned recordset. I usually use an output parameter for my stored procedure. A value of 0 or 1 type tinyint. Evaluate the return data and do your stuff. The sql will look something like this: Select * from yourCardTable WHERE cardnumber = " & dropDownCardNumber.SelectedText & " AND pinnumber = " & txtPIN IF the returned table has records, we have a match. OR in a stored procedure(return 0 or 1) CREATE PROCEDURE() @ReturnValue TINYINT OUTPUT, @CCNumber VARCHAR(20), @PINNumber VARCHAR(4) AS SET @ReturnValue=0 IF EXISTS( Select * from yourCardTable WHERE cardnumber = @CCNumber AND pinnumber = @PINNumber) BEGIN @ReturnValue = 1 END SELECT @ReturnValue
|