Solved

Could someone clarify 'why' this worked out the way it did...

Posted on 2006-07-11
7
162 Views
Last Modified: 2006-11-18
I completed a hands-on project from a textbook I'm reading.

The purpose was to create a composite user control (containing identifying labels and text boxes) referencing a "Person" structure.

Now, it 'worked' okay, but only after I made one minor change to my container form:

The book's solution calls for the form's OK button procedure to be:

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        'Retrieve the entered information
        Dim perPerson As Person

        perPerson = NameEntry.PersonText
        MessageBox.Show( _
        perPerson.id & ControlChars.NewLine & _
        perPerson.Name & ControlChars.NewLine & _
        perPerson.address & ControlChars.NewLine & _
        perPerson.city & ", " & perPerson.state & _
        " " & perPerson.zip, "Display Entered Information")
    End Sub

Where mine ended up 'having' to be:

   Dim perPerson as Person.Person

How come?
0
Comment
Question by:sirbounty
  • 4
  • 3
7 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 250 total points
ID: 17082863
The first Person is the namespace, which would suggest that the Person class is in a different namespace to the Form.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17082971
So, I didn't do what I was instructed to do?  Hmmm - let me check again...
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17083183
Rootspace for "Person" is
Ch12HandsOn
for frmDataEntry is
Ch12HandsOn

This obtained by right-clicking each project and choosing properties...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 67

Author Comment

by:sirbounty
ID: 17083272
I recreated from scratch and still have the same symptoms...
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17083535
Is there any additional namespace defined for the Person class other than the root namespace ?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17083536
i.e.

Anything like:

    Namespace Person
        Public Class Person
        End Class
    End Namespace

?
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17083570
I searched the entire projects for "names" (namespace) and it came up empty.
I don't know.  This was supposed to be a 'learn how to do it before you actually do' example.
I'm just a bit discouraged that the meat of the text never dealt with this issue and then right there at the last example, it was dropped in there.  <sigh>
I've given up on it and moved on to my actual assignment.  Thanx anyway - points are yours for the attempt.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

23 Experts available now in Live!

Get 1:1 Help Now