Hi guys, I having problem display out the value at the gridview. At the database it store the gender field in integer. For example 1 = Male and etc.
I need to display out the text at gridview column. I getting error input string was not correct. Please help
Protected Sub gvCustomer_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvCustomer.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim gender As Integer = Convert.ToInt32(e.Row.Cells(5).Text)
If gender = 1 Then
e.Row.Cells(5).Text = "MALE"
ElseIf gender = 2 Then
e.Row.Cells(5).Text = "FEMALE"
End If
End If
End Sub