G
Guest
Can someone please tell me what is wrong with the following code!
I have a record in the datareader but it isn't showing up and niether is the
label... I presume there is a problem with this code!
Thanks
...CODE..
Dim myReader As SqlDataReader = cmd.ExecuteReader()
Dim hasRows As Boolean
hasRows = False
DGPages.DataSource = myReader
While myReader.Read()
hasRows = True
If hasRows = True Then
DGPages.DataBind()
ElseIf hasRows = False Then
lblNoContent.Visible = True
lblNoContent.Text = "There a currently no pages for"
End If
End While
myReader.Close()
I have a record in the datareader but it isn't showing up and niether is the
label... I presume there is a problem with this code!
Thanks
...CODE..
Dim myReader As SqlDataReader = cmd.ExecuteReader()
Dim hasRows As Boolean
hasRows = False
DGPages.DataSource = myReader
While myReader.Read()
hasRows = True
If hasRows = True Then
DGPages.DataBind()
ElseIf hasRows = False Then
lblNoContent.Visible = True
lblNoContent.Text = "There a currently no pages for"
End If
End While
myReader.Close()