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
Register
Register | 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 30th, 2010, 11:51 PM
Registered User
 
Join Date: Dec 2009
Location: Melb Aus
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to Blackprince
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
Code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As  _
                                System.EventArgs) Handles btnSearch.Click

        Try



            Dim custCB As SqlClient.SqlCommandBuilder = New  _
            SqlClient.SqlCommandBuilder(adapterResults)
            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.Expand(-1)
                'dgdResults.NavigateTo(o, Results)
                MsgBox("Number of record found = " & dsResults.Tables("Results").Rows.Count)
                MsgBox("Found some records matching your search criteria.")
            Else
                MsgBox("There are no records matching your search criteria.")
            End If



        Catch
            ' Error handling goes here
            UnhandledExceptionHandler()
        End Try
    End Sub
Reply With Quote
  #2 (permalink)  
Old February 6th, 2010, 08: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
Default

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

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


Thread Tools
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 07:32 AM
form re-appearing problem Derek_05 Access VBA 1 January 16th, 2006 06: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 01:30 PM.


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