Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
<serializable()>
   Public Class BeanstreamHash

       Private _merchantID As Long
       Public Property MerchantID() As Long
           Get
               Return _merchantID
           End Get
           Set(ByVal value As Long)
               _merchantID = value
           End Set
       End Property
       Private _alphanumericValue As String
       Public Property AlphanumericValue() As String
           Get
               Return _alphanumericValue
           End Get
           Set(ByVal value As String)
               _alphanumericValue = value
           End Set
       End Property
   End Class


and i am assigning it in

VB
    Dim result As String = DAL.GetAlphanumericValue(MerchantID)
         If Not result Is Nothing Then
             beanstreamhash = New CommonObjects.BeanstreamHash
          beanstreamhash.MerchantID = MerchantID
             beanstreamhash.AlphanumericValue = result
          RetVal.BeanstreamList.Add(beanstreamhash)

        End If
    Catch ex As Exception


    End Try

    Return RetVal

End Function


Please help.
Posted
Updated 27-Feb-13 15:59pm
v3
Comments
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.
—SA
vidkaat 27-Feb-13 15:53pm    
Solved..Thanks

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900