I was trying to make it so when my button is clicked, it will run through a series of tasks or things to do, but i want it so when if it fails to do anything of those tasks it will (do something) - Like Use MsgBox("This Operation Could Not Be Completed...")
Here Is My Button Code :
Private Sub SelectBtn_Click(sender As Object, e As EventArgs) Handles SelectBtn.Click
Dim res = client.Get("Logins/" + usernamebox.Text)
Dim std As New Student()
std = res.ResultAs(Of Student)
If std.Password = passwordbox.Text Then
MsgBox("Welcome Back! " + usernamebox.Text + "!")
Else
MsgBox("Username OR Password May Be Wrong", MsgBoxStyle.Exclamation, "Login Error")
End If
End Sub
Okay So This Is My Buttons Code, Its Getting Data From Firebase.. But I Want It So When It Fails It Will Not Break The Program.. And Instead It Displays A Message... The Reason Why I Want This Is For Some Reason The Program Breaks When A Value Doesnt "Exist" It Breaks And I Just Want A Message To Display If It Tries To Break And It To Carry On To Click It Again Etc.. Sorry For The Way I Type Im So Used To Visual Studio 2019... The Formatting Of Things Really Messed Me Up...
EDIT :
question from:
https://stackoverflow.com/questions/65617200/visual-basic-vb-net-how-to-check-if-task-could-not-be-completed 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…