Am slowly learning VB 2005. Tuf transition for me. Want to check if there is data in a db. Here is what I have so far:
This will go through each record when all that is needed is to find one. Also, if there is a blank record (more trouble) it will return false.
Appreciate any help.
Thanks.
Code:
Public Sub MTDatabase(ByRef bFound As Boolean)
Dim dr As DataRow
ds = New DataSet()
cmd = New OleDbCommand("SELECT * FROM Members", cn)
da.SelectCommand = cmd
da.Fill(ds, "Members")
Try
For Each dr In ds.Tables("Members").Rows
If dr.IsNull(1) Then
bFound = False
Else
bFound = True
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub
Appreciate any help.
Thanks.