Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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
 <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
 
           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 27-Feb-13 10:33am
vidkaat537
Edited 27-Feb-13 16:59pm
v3
Comments
Sergey Alexandrovich Kryukov at 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 at 27-Feb-13 15:53pm
   
Solved..Thanks

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 /\jmot 240
1 Richard Deeming 195
2 Richard MacCutchan 190
3 Zoltán Zörgő 175
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 9,328
1 OriginalGriff 6,831
2 Peter Leow 4,477
3 Zoltán Zörgő 3,984
4 Richard MacCutchan 2,832


Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2015
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