cmd.ActiveConnection = cn
cmd.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
cmd.CommandText = "sp_login"
cmd.Parameters.Append( _
cmd.CreateParameter("result", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamOutput))
cmd.Parameters.Append( _
cmd.CreateParameter("user", ADODB.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput, 15, TextBox1.Text))
cmd.Parameters.Append( _
cmd.CreateParameter("passuser", ADODB.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput, 15, TextBox2.Text))
rs.Open(cmd, , ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
If rs.Fields!result.Value = 1 Then
AddProduct.Show()
Else
MsgBox("Your Username or Password is Incorrect", MsgBoxStyle.Information, "AEB Gasul System")
Exit Sub
End If
this is my stored procedure code
CREATE PROCEDURE sp_login
(
@user varchar(15),
@passuser varchar(15),
@result integer OUTPUT
)
AS
if exists (select userlogin, pass from dbo.tbl_login where userlogin = @user and pass = @passuser)
begin
Select 1 as result
end
GO
how can i get the result value in stored procedure?