Solved

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

Posted on 2010-08-20
3
506 Views
Last Modified: 2012-05-10
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 >>>>>>
0
Comment
Question by:rwdMike
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33487427
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.
0
 

Accepted Solution

by:
rwdMike earned 0 total points
ID: 33487567
This was from simple directions in an ASP.NET book, which said to simply drag/drop the grid onto the designer:

<body>
    <form id="form1" runat="server">
    <span class="newStyle1">Data Grid<br />
    </span>
    <br />
    <br />
    <asp:GridView ID="EmployeeGrid" runat="server">
    </asp:GridView>
   
    </form>
   
     
   
</body>
0
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33487776
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question