Hi!
I'm using Microsoft Visual Studio 2008, Microsoft SQL Server Management Studio.
I need help. I cant figure out this if else statement for this condition:
///to check condition either the way ID exist in database
///if not exist then way ID can be delete
///if exist, message box appear show message this cannot be delete
My code was be like this.
Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim i As Integer
Dim iResult As Integer
Dim hypWayID As HyperLink
Dim chkRemove As New CheckBox
Dim clsWay As New Way()
Try
For i = 0 To grdWay.Rows.Count - 1
chkRemove = DirectCast(grdWay.Rows(i).FindControl("chkRemove"), CheckBox)
hypRouteID = DirectCast(grdWay.Rows(i).FindControl("hypWayID"), HyperLink)
If chkRemove.Checked Then
///to check condition either the way ID exist in database
///if not exist then way ID can be delete
///if exist, message box appear show message this cannot be delete
iResult = clsWay.DeleteRoute(hypWayID.Text)
End If
Next i
labelError.Text = "Item(s) delete successfully."
BindGrid("%", "%", drpArea.SelectedValue,drpType.SelectedValue)
Catch ex As Exception
lblError.Text = ex.Message
End Try
End Sub
Anyone can help me? :(