gridview with blank rows

E

eagle

I have a gridview that I am binding dynamically, and the gridview does have
records in it but they are all blank except for the "Select". What am I
missing:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="true">
</asp:GridView>



Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Try
Call BindGrid
catch ex as exception
Message.innerhtml = "Error!"
end try
End Sub
private Sub BindGrid
Dim bError as Boolean
Dim ds as data.dataset = nothing
Dim qry as String
qry = "myStoredProcedure"
ds = _BL.GetDataSet(qry, bError)

gridview1.DataSource = ds
gridview1.DataBind

End Sub

Public Function GetDataSet(ByVal qry As String, Optional ByRef bError as
Boolean=False) As Dataset

Try
Dim ds as New Data.dataset
ds = _DL.GetDataSet(qry, bError)
If bError = False
return ds
else
return nothing
End If
Catch ex As Exception
Throw New Exception("GetDataSet Error: " & ex.Message)
End Try
End Function

Public Function GetDataSet(ByVal qry As String, Optional ByRef boolError
as Boolean=False) As Dataset

boolError = False
Dim t(0) as string
t(0) = "myTable"

Dim ds as new DataSet
Try
SqlDataAccess.FillDataset(_sSQLConn, CommandType.text, qry, ds,
t)
If ds.Tables.Count = 0 then
Throw new exception("No data found")
else
Dim dt As DataTable = ds.Tables(0)
If dt.Rows.Count = 0 Then
Throw new exception("No data found")
End If
Return ds
end if
Catch ex as Exception
Throw new exception("No data found")
Exit Try
Finally
ds.Dispose()
ds = Nothing
End Try
Return nothing
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,930
Messages
2,570,072
Members
46,522
Latest member
Mad-Ram

Latest Threads

Top