473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ambiguous Match Exception--Help Please

I am getting an ambiguous matche exception on a piece of code and I dont know why. I have a similar property setup that runs just fine....

This Property runs fine.
--------------------------------------
#Region "PrePack Enumeration"
Public Enum PrePackTypes
ICEPACK
TRAYPACK
End Enum
' Private mPrepack As Boolean
Private xPrepack As PrePackTypes
Public Shadows Property Prepack() As PrePackTypes
Get
Select Case MyBase.PrePack
Case True
xPrepack = PrePackTypes.TRAYPACK
Case False
xPrepack = PrePackTypes.ICEPACK

End Select

Return xPrepack
End Get
Set(ByVal Value As PrePackTypes)

xPrepack = Value
Select Case xPrepack
Case PrePackTypes.ICEPACK
MyBase.PrePack = False
Case PrePackTypes.TRAYPACK
MyBase.PrePack = True
End Select
End Set
End Property
#End Region
----------------------------------------------------------------
This property does not
=============================================
#Region "TareType Enumeration"
Public Enum TareTypes
STANDARD
PERCENTAGE
End Enum

'Private mTareType As Boolean
Private xTaretype As TareTypes
Public Shadows Property TareType() As TareTypes
Get

Select Case MyBase.TareType
Case True
xTaretype = TareTypes.PERCENTAGE
Case False
xTaretype = TareTypes.STANDARD
End Select
Return xTaretype

End Get
Set(ByVal Value As TareTypes)
xTaretype = Value
Select Case xTaretype
Case TareTypes.PERCENTAGE
MyBase.TareType = True
Case TareTypes.STANDARD
MyBase.TareType = False
End Select
End Set
End Property
'
#End Region

=========================================

Here is the line of code I am processing.
++++++++++++++++++++++++++++++++++++++++++

Public Shared Function checkForChanges(ByVal obj As Object, ByVal obj_original As Object, ByVal pType As Type) As Boolean
Dim ischanged As Boolean = False
Try
Dim Properties() As PropertyInfo = pType.GetProperties(BindingFlags.Public Or BindingFlags.Instance)
Dim PropertyItem As PropertyInfo
For Each PropertyItem In Properties
With PropertyItem
******************
BREAKS HERE*****
******************
Debug.WriteLine(String.Format("New {0}={1}", obj.GetType.GetProperty(PropertyItem.Name).Name, obj.GetType.GetProperty(PropertyItem.Name).GetValu e(obj, Nothing)))
Debug.WriteLine(String.Format("Original {0}={1}", obj_original.GetType.GetProperty(PropertyItem.Name ).Name, obj_original.GetType.GetProperty(PropertyItem.Name ).GetValue(obj_original, Nothing)))
*******************
If ischanged = False Then
******************
BREAKS HERE*****
******************
If Not obj.GetType.GetProperty(PropertyItem.Name).GetValu e(obj, Nothing).Equals(obj_original.GetType.GetProperty(P ropertyItem.Name).GetValue(obj_original, Nothing)) Then
******************
ischanged = True
End If
End If
End With
Next
Return ischanged

Catch ex As Exception
MessageBox.Show(ex.ToString, "Exception Thrown")
Return False
Finally

End Try
End Function


--Eric Cathell, MCSA
Nov 21 '05 #1
0 1209

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Steve Kirsch | last post by:
I need a simple function that can match the number of beginning and ending parenthesis in an expression. Here's a sample expression: ( ( "john" ) and ( "jane" ) and ( "joe" ) ) Does .NET have...
2
by: Denon | last post by:
Hi, everybody I have a web control, build by VB.net, and if I put two instance on the same aspx, error occur while debugging. Parser Error Message: Ambiguous match found. It highlight the...
3
by: Ben | last post by:
Hi I have just created a new ASP .net web project and when i run the project I receieve this error: System.Reflection.AmbiguousMatchException: Ambiguous match found. Any help would be much...
3
by: Alexandre | last post by:
Hi! I receive this error in my webapp: Ambiguous match found. At line: Line 1: <%@ page language="C#" masterpagefile="~/memberscontents/master_interna.master" autoeventwireup="true"...
2
by: pvl_google | last post by:
Hi, I'm trying to extend an STL class with additional iterator functionality. In the simplified example below I added an extra iterator class with a dereferencing operator. This operator...
3
by: Francois | last post by:
This is from a Dot Net 1.1 project converted to Dot Net 2.0. In 1.1, all was fine without any problem. In 2.0, on the developement machine all seems more or less OK. In release mode on the...
3
by: i3x171um | last post by:
To start off, I'm using GCC4. Specifically, the MingW (setjmp/longjmp) build of GCC 4.2.1 on Windows XP x64. I'm writing a class that abstracts a message, which can be either an integer (stored as...
2
by: aparna | last post by:
Hi, I have one project in dotnet 1.1and when I am trying to compile that project I am getting "Ambiguous match found" error in code behind file(.aspx.cs) but there is no such file in that...
9
by: sebastian | last post by:
I've simplified the situation quite a bit, but essentially I have something like this: struct foo { }; void bar( foo const & lhs, foo const & rhs )
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.