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 9:33am
vidkaat506
Edited 27-Feb-13 15: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
Your Filters
Interested
Ignored
     
0 Shai Vashdi 540
1 Tadit Dash 305
2 Sergey Alexandrovich Kryukov 250
3 Peter Leow 190
4 OriginalGriff 148
0 Sergey Alexandrovich Kryukov 9,395
1 OriginalGriff 5,473
2 Peter Leow 4,150
3 Maciej Los 3,540
4 Abhinav S 3,333


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