Solved

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

Posted on 2010-08-20
3
513 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

732 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