Solved

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

Posted on 2006-07-11
7
163 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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 …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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