Friday, September 19, 2014

vb.net (add data to datagridview with condition)

       Dim _xdtRow As Integer = 0
        For _xdtRow = 0 To odt2.Rows.Count - 1
            If Dgvuserlist.Rows.Count < 0 Then
                Dgvuserlist.Rows.Clear()
            Else
                If odt2.Rows(_xdtRow).Item(5).ToString = "0" Then
                    Dgvuserlist.Rows.Add("Male")
                Else
                    Dgvuserlist.Rows.Add("Female")
                End If
            End If
        Next

No comments:

Post a Comment