Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Using command As New SqlCommand("select dbo.Fn_User_Exist_Usuario(@USUARIO)", connection)
'text command.CommandType = Data.CommandType.StoredProcedure
Dim myParam1 As New SqlParameter("@USUARIO", VarChar, 150)
myParam1.Direction = Data.ParameterDirection.Input
myParam1.Value = UserName
command.Parameters.Add(myParam1)
connection.Open()
Dim Exist As Boolean = Convert.ToBoolean(command.ExecuteScalar())
Return Exist
End Using
End Using
|