Solved

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

Posted on 2010-08-20
3
503 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
Comment Utility
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
Comment Utility
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
Comment Utility
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
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.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now