Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > BOOK: Beginning VB.NET Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET Databases
This is the forum to discuss the Wrox book Beginning VB.NET Databases by Thearon Willis; ISBN: 9780764568008
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 31st, 2010, 12:51 AM
Registered User
Join Date: Dec 2009
Location: Melb Aus
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Records not appearing in DataGridView - Why?

I have enetred the code to load the data into the DataGridView dsResults as directed in Chapter 7 but the records do not appear even though Debug displays that 9 records were found. What did I do wrong or whats missing from my code? Please help.
I checked the code over and over and it seems to comply with the code in the book though pointing to my Database.

Is there something else I need to do when using a DataGridView as opposed to a DataGrid which is used in the book?

Here is the code for btnSearchClick
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As  _
                                System.EventArgs) Handles btnSearch.Click


            Dim custCB As SqlClient.SqlCommandBuilder = New  _
            Dim clsdatabase As New clsDatabase()
            Dim strSQL As String = ""

            ' Load a DataSet with the complete Products, Customers and
            ' Customer Contacts tables (to be used later as code tables to display
            ' choices in a list, etc
            dsData = clsdatabase.LoadCompleteDataSet(CONN)

            ' Load a DataSet with the search results based on the criteria
            ' specified by the user on the form.

            strSQL = BuildSQLStatement()
            dsResults = clsdatabase.LoadSearchDataSet(CONN, strSQL)

            If dsResults.Tables("Results").Rows.Count > 0 Then
                dgdResults.DataSource = dsResults
                'dgdResults.NavigateTo(o, Results)
                MsgBox("Number of record found = " & dsResults.Tables("Results").Rows.Count)
                MsgBox("Found some records matching your search criteria.")
                MsgBox("There are no records matching your search criteria.")
            End If

            ' Error handling goes here
        End Try
    End Sub
Reply With Quote
  #2 (permalink)  
Old February 6th, 2010, 09:18 AM
Thearon's Avatar
Wrox Author
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts

What version of Visual Studio are you using?
Reply With Quote
  #3 (permalink)  
Old February 21st, 2010, 01:12 AM
Registered User
Join Date: Dec 2009
Location: Melb Aus
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Records not appearing on DataGridView- Why

I am using Visual Studio 2008. Thanks - was away for a while.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
instead of font boxes appearing macdev BOOK: Beginning Mac OS X Programming 1 August 22nd, 2007 05:27 AM
Database not appearing in browser sevans BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 May 30th, 2007 06:46 AM
Add records from a DataGridView to SQL Server 2000 VS2005 Visual Basic 2005 Basics 2 November 27th, 2006 08:32 AM
form re-appearing problem Derek_05 Access VBA 1 January 16th, 2006 07:50 PM
Javascript Errors Not Appearing itHighway Javascript How-To 1 October 13th, 2005 01:30 AM

All times are GMT -4. The time now is 04:11 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.