You cannot make a direct comparison between two different types, even if they
are otherwise identical. Since your two structures are set up identically,
you could use one structure instead:
Dim struct1 as New A
dim struct2 as New A
dim n1 as String = "Bill"
din n2 as String = "bill"
struct1.Fname = n1.ToLower
struct2.Fname = n2.ToLower
If struct1.Equal(struct2) then
messagebox.show("equal")
end if
Since the Structure is not a simple datatype, you must use equals, rather
than " = ", which you would use for simple data types.
For example, if you had two separate structures, you could compare any
string value in one structure with any string value in another structure
using " = ".
www.charlesfarriersoftware.com
"Kiran B." wrote:
Hi, I am new to .net. I have two Data Structure Type ... Sturcture A and
Structure B.
Structure A
Public Fname as String
Public LastName as String
Public City as String
Public Zip as String
End Structure
Structrure B
Public Fname as String
Public LastName as String
Public City as String
Public Zip as String
End Structure
How can I compare these two data types.. ie Fname, LastName, City, Zip of
Structure A should match Fname, LastName, City, Zip of Sturcture [shouldn't
be ase sensitive.]
If Sturcture A = Structure Then
Do tthis ..
Else
End if
Thanks in advance.