?
Solved

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

Posted on 2010-08-20
3
Medium Priority
?
519 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

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

752 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