Click here to Skip to main content
12,447,999 members (93,330 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
Hi All,

I am trying to assign a string to a property of type string.The string contains value "ADcgy9392tYrq"...When i assign to the property it becomes "A".Here is my code
   Public Class BeanstreamHash
       Private _merchantID As Long
       Public Property MerchantID() As Long
               Return _merchantID
           End Get
           Set(ByVal value As Long)
               _merchantID = value
           End Set
       End Property
       Private _alphanumericValue As String
       Public Property AlphanumericValue() As String
               Return _alphanumericValue
           End Get
           Set(ByVal value As String)
               _alphanumericValue = value
           End Set
       End Property
   End Class

and i am assigning it in

    Dim result As String = DAL.GetAlphanumericValue(MerchantID)
         If Not result Is Nothing Then
             beanstreamhash = New CommonObjects.BeanstreamHash
          beanstreamhash.MerchantID = MerchantID
             beanstreamhash.AlphanumericValue = result
        End If
    Catch ex As Exception

    End Try
    Return RetVal
End Function

Please help.
Posted 27-Feb-13 9:33am
Updated 27-Feb-13 15:59pm
Sergey Alexandrovich Kryukov 27-Feb-13 15:40pm
Which member: MerchantID (not a string) or AlphanumericValue (a string)? Should not be a problem. The class looks correct, your testing can be wrong. Use the debugger correctly and pay attention.
Why do you block exception propagation!? Remove exception handler at all.
vidkaat 27-Feb-13 15:53pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

According to your class code, no it doesn't. So either you're actually assigning the string "A" to the property, or you're not interpreting something correctly and you think it's only an "A" in the string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100