Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

Search DGV for date then launch url

$
0
0
I have a dgv that I need a button to search each row in a column for today's date or past date and for each one that is true launch the url that is in column 7. Heres the code i have tried but I am getting and error "Object reference not set to an instance of an object."
Code:

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        For Each row As DataGridViewRow In ShowListView.Rows
            If row.Cells(6).Value IsNot Nothing Then
                Date.Compare(Date.Parse(row.Cells(6).Value.ToString()), Date.Parse(Today))
                Dim url As String = ShowListView.Columns("Web Link").ToString ' ("Web LinK") should be column 7
                Process.Start(url)
            End If
        Next
    End Sub


Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>