Link to home
Start Free TrialLog in
Avatar of rwdMike
rwdMike

asked on

Cannot get GridView to display Data (VB.Net / VS2008

Hello,

I cannot get Gridview to show my data.  I've tryed using a Datatable and a Oledb Reader.  I've verified that both contain the data and the rows.  

After the .databind call, i verify that the gridview has all 59 rows, but it doesn't display on the web page.   I've already tried turning autogeneratecolumns to true

This is a sub in my default.aspx.vb file, which executes.  Note that i've already instantiated the new gridview (Connectdb is a class with all db functions, dbQueryResult returns a datareader)

Any suggestions???

>>>> CODE <<<<<<
       Dim dbConn As New Connectdb
            If dbConn.dbConnect Then
                sSQL = "Select LastName,FirstName FROM tblEmployees"
                Dim dt As DataTable
                dt = New DataTable

                If dbConn.dbExecQuery(sSQL, gQueryType.ReaderQuery) Then
                   
                    dt.Load(dbConn.dbQueryResult)
                   
                    EmployeeGrid.DataSource = dt
                    EmployeeGrid.DataBind()

                    dbConn.dbClose()
                End If
            End If

<<<<<<< CODE >>>>>>
Avatar of Anil Golamari
Anil Golamari
Flag of United States of America image

Can you paste the aspx page code for the grid view. As you said that if you are getting data at
EmployeeGrid.DataBind() then we can look at the front end code.
ASKER CERTIFIED SOLUTION
Avatar of rwdMike
rwdMike

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial