Solved

Error Messages Appearing in Class Design

Posted on 2012-04-05
3
396 Views
Last Modified: 2012-04-09
I am attempting to write a C# class that will be used in addition to several other smaller classes to make up a larger business entity. I have written a sample class, and I am getting error messages before I run the code when I am attempting to design it. I am receiving the following error messages below. I have attached the sample class that I have written for my one part of my structure below the errors. Could someone help me figure out why I am receiving the error messages when I am attempting to design the basic class? Any help would be greatly appreciated.

Error      1      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      32      18      EOISampleDesign
Error      2      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      33      18      EOISampleDesign
Error      3      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      34      18      EOISampleDesign
Error      4      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      35      18      EOISampleDesign
Error      5      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      36      18      EOISampleDesign
Error      6      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      37      18      EOISampleDesign
Error      7      'EOISampleDesign.EOIBusinessEntity.PolicyHolder' does not contain a definition for 'FromXml' and no extension method 'FromXml' accepting a first argument of type 'EOISampleDesign.EOIBusinessEntity.PolicyHolder' could be found (are you missing a using directive or an assembly reference?)      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      48      38      EOISampleDesign
Error      8      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      49      18      EOISampleDesign
Error      9      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      49      47      EOISampleDesign
Error      10      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      50      18      EOISampleDesign
Error      11      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      50      37      EOISampleDesign
Error      12      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      51      18      EOISampleDesign
Error      13      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      51      39      EOISampleDesign
Error      14      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      52      18      EOISampleDesign
Error      15      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      52      30      EOISampleDesign
Error      16      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      53      18      EOISampleDesign
Error      17      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      53      31      EOISampleDesign
Error      18      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      54      18      EOISampleDesign
Error      19      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      54      33      EOISampleDesign
Error      20      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      63      31      EOISampleDesign
Error      21      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupPolicyholderName'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      64      24      EOISampleDesign
Error      22      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      69      31      EOISampleDesign
Error      23      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.groupNumber'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      70      24      EOISampleDesign
Error      24      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      76      31      EOISampleDesign
Error      25      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.streetAddress'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      77      24      EOISampleDesign
Error      26      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      82      31      EOISampleDesign
Error      27      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.city'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      83      24      EOISampleDesign
Error      28      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      88      31      EOISampleDesign
Error      29      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.state'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      89      24      EOISampleDesign
Error      30      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      94      31      EOISampleDesign
Error      31      Ambiguity between 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode' and 'EOISampleDesign.EOIBusinessEntity.PolicyHolder.zipCode'      C:\Documents and Settings\TLHN\my documents\visual studio 2010\Projects\EOISampleDesign\EOISampleDesign\EOIBusinessEntity\PolicyHolder.cs      95      24      EOISampleDesign

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.Serialization;
using System.Collections;
using System.Collections.Generic;

namespace EOISampleDesign.EOIBusinessEntity
{
    public class PolicyHolder
    {
        #region Private Variables
        private string groupPolicyholderName;
        private string groupNumber;
        private string streetAddress;
        private string city;
        private string state;
        private string zipCode;

        #endregion


        #region Constructors
        
        /// <summary>
        /// Default constructor.
        /// </summary>
        public PolicyHolder()
        {
            this.groupPolicyholderName = "";
            this.groupNumber = "";
            this.streetAddress = "";
            this.city = "";
            this.state = "";
            this.zipCode = "";
        }


        /// <summary>
        /// Constructor building the intstance from the Xml string.
        /// </summary>
        /// <param name="xmlString"></param>
        public PolicyHolder(string xmlString)
            : this()
        {
            PolicyHolder temp = this.FromXml(xmlString);
            this.groupPolicyholderName = temp.groupPolicyholderName;
            this.groupNumber = temp.groupNumber;
            this.streetAddress = temp.streetAddress;
            this.city = temp.city;
            this.state = temp.state;
            this.zipCode = temp.zipCode;

        }
        #endregion


        #region Public Properties
        public string groupPolicyholderName
        {
            get { return this.groupPolicyholderName; }
            set { this.groupPolicyholderName = value; }
        }

        public string groupNumber
        {
            get { return this.groupNumber; }
            set { this.groupNumber = value; }
        }


        public string streetAddress
        {
            get { return this.streetAddress; }
            set { this.streetAddress = value; }
        }

        public string city
        {
            get { return this.city; }
            set { this.city = value; }
        }

        public string state
        {
            get { return this.state; }
            set { this.state = value; }
        }

        public string zipCode
        {
            get { return this.zipCode; }
            set { this.zipCode = value; }
        }

        #endregion
    }
}

Open in new window

0
Comment
Question by:thenthorn1010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
ambience earned 250 total points
ID: 37815675
The problem is that you are using the same names for datamembers and property names

        private string groupNumber;
        public string groupNumber
        {
            get { return this.groupNumber; }
            set { this.groupNumber = value; }
        }

So how does the compiler know whether the bolded line is referring to the field or the property. Try changing the names for dataMembers like

        private string _groupNumber;
        public string groupNumber
        {
            get { return this._groupNumber; }
            set { this._groupNumber = value; }
        }

OR you can just let the compiler emit fields automatically. Delete all datamembers and change your Properties to

        public string groupNumber
        {
            get;
            set;
        }

The compiler will see that you want it to use vanilla wrappers and supply fields to back.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 37815812
Without really digging through all that code (not my favorite task), I would suggest that any ambiguity errors are based on the fact that the compiler could resolve multiple classes with the same methods and signature.  That can be overcome by fully qualified the namespace, or removing any using statements that create the conflict.
0
 
LVL 22

Expert Comment

by:ambience
ID: 37823334
how was 37815812 relevant or different? oh well ...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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