Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8
This is the forum to discuss the Wrox book Wrox's Visual Basic 2005 Express Edition Starter Kit by Andrew Parsons; ISBN: 9780764595738
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 4th, 2008, 06:24 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7 - Try it out "Adding a database..."

I am absolutely stuck on this chapter. I followed every step in the book and I still can not get my DB info to show on the PersonList control.
I reviewed the Errata for this chapter, but it is not my case, the connecting string does match with my database.
I even created a new application ad tried to do the same on a listBox in the main form and it works just fine. Then I created a UserControl with a listbox and a button + handler to call the control and Ooops!... failed again.

It there a bug in this operation?... is there any additional code/configuration to twick a UserControl to get this to work?

If any one knows the answer, please help!!!!

Reply With Quote
  #2 (permalink)  
Old March 6th, 2008, 01:12 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the answer to my dilemma!

When a database table is dragged into a control (like a list box), the binding is automatically setup by VB for the control, but the command line (in this case I am working with the "Person" table from DB "PO Database"):

     Me.PersonTableAdapter.Fill(Me._PO_DataDataSet.Pers on)

is created on the main form only, so whenever this method is used on a UserControl (like the Personlist.vb), that line must be present on the "Load" sub for the control itself, otherwise the binding will not work:

Public Class PersonList

    Private Sub PersonList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.PersonTableAdapter.Fill(Me._PO_DataDataSet.Pers on)

   End Sub

I hope this helps if You got stock with the same problem!!
End Class

Reply With Quote
Reply


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
Chapter 3 - Extra Credit Code [Adding To Database] lcoon BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 1 November 15th, 2009 03:00 AM
Chapter 1 - Getting Started - Adding Connection roscoe BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 6 November 6th, 2006 05:03 AM
Chapter 2: Adding Arrays Invincible Pear BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 4 January 2nd, 2006 07:25 AM
Chapter 1 - Adding PHP to the Equation Chudz BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 June 27th, 2005 06:21 PM
Chapter 1 - Adding PHP to the Equation Chudz BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 7 June 22nd, 2005 11:32 AM



All times are GMT -4. The time now is 11:52 AM.


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