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

How do you refer to ALL rows contained within a database?

$
0
0
Hi,

I'm using a local database to save check in and check out dates. I then need to check if a certain date is within those dates. It works fine when I start with the program with the database being empty, but if the table already contains dates, I'm unable to refer to those rows.

Error is "There is no row at position 0.", but if i open the table, there is a row at position 0

Code:

Dim all As Integer
all = Val(formDb.DsRoom.room1.Rows.Count)



If Not IsDBNull(formDb.DsRoom.room1) Then

        If DateValue(dtpInHome.Text) >= formDb.DsRoom.room1.Rows(all).Item(2) Then

            MsgBox("This date is booked")

        End If

    End If


Viewing all articles
Browse latest Browse all 27173

Trending Articles



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