VB.NET codeDom

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MikeG

    VB.NET codeDom

    Attempting to add a property to a class using
    CodePropertySet ValueReferenceE xpression to add the set statement does not add
    (byval value as <type>) so using te property fails. Any ideas?

    MikeG
  • Naveen

    #2
    RE: VB.NET codeDom


    Hi Mike..

    What error you are getting ? There is an excellent example on MSDN which
    helps you for this...



    HTH

    With Best Regards
    Naveen K S

    "MikeG" wrote:
    [color=blue]
    > Attempting to add a property to a class using
    > CodePropertySet ValueReferenceE xpression to add the set statement does not add
    > (byval value as <type>) so using te property fails. Any ideas?
    >
    > MikeG[/color]

    Comment

    • MikeG

      #3
      RE: VB.NET codeDom

      Thanks Naveen,

      I dont get an error as such, the property is created as

      Private Property integerProperty () As Integer
      Get
      Return Me.integerField
      End Get
      Set
      Me.integerField = value
      End Set
      End Property

      whereas it should be

      Private Property integerProperty () As Integer
      Get
      Return Me.integerField
      End Get
      Set(ByVal Value As Integer)
      Me.integerField = value
      End Set
      End Property

      and so the application created does not work and it returns the error

      "System.Missing MethodException : Method not found: Void
      LEATESTNamespac e.cLEADataEntit y.set_name(Syst em.String)."

      Regards,

      MikeG


      "Naveen" wrote:
      [color=blue]
      >
      > Hi Mike..
      >
      > What error you are getting ? There is an excellent example on MSDN which
      > helps you for this...
      >
      > http://msdn.microsoft.com/library/de...ClassTopic.asp
      >
      > HTH
      >
      > With Best Regards
      > Naveen K S
      >
      > "MikeG" wrote:
      >[color=green]
      > > Attempting to add a property to a class using
      > > CodePropertySet ValueReferenceE xpression to add the set statement does not add
      > > (byval value as <type>) so using te property fails. Any ideas?
      > >
      > > MikeG[/color][/color]

      Comment

      • MikeG

        #4
        RE: VB.NET codeDom

        Sorry the actual code produced is:

        Private Property integerProperty as system.void
        Get
        Return Me.integerField
        End Get
        Set
        Me.integerField = value
        End Set
        End Property

        whereas it should be

        Private Property integerProperty () As Integer
        Get
        Return Me.integerField
        End Get
        Set(ByVal Value As Integer)
        Me.integerField = value
        End Set
        End Property

        Thanks,

        MikeG

        "MikeG" wrote:
        [color=blue]
        > Thanks Naveen,
        >
        > I dont get an error as such, the property is created as
        >
        > Private Property integerProperty () As Integer
        > Get
        > Return Me.integerField
        > End Get
        > Set
        > Me.integerField = value
        > End Set
        > End Property
        >
        > whereas it should be
        >
        > Private Property integerProperty () As Integer
        > Get
        > Return Me.integerField
        > End Get
        > Set(ByVal Value As Integer)
        > Me.integerField = value
        > End Set
        > End Property
        >
        > and so the application created does not work and it returns the error
        >
        > "System.Missing MethodException : Method not found: Void
        > LEATESTNamespac e.cLEADataEntit y.set_name(Syst em.String)."
        >
        > Regards,
        >
        > MikeG
        >
        >
        > "Naveen" wrote:
        >[color=green]
        > >
        > > Hi Mike..
        > >
        > > What error you are getting ? There is an excellent example on MSDN which
        > > helps you for this...
        > >
        > > http://msdn.microsoft.com/library/de...ClassTopic.asp
        > >
        > > HTH
        > >
        > > With Best Regards
        > > Naveen K S
        > >
        > > "MikeG" wrote:
        > >[color=darkred]
        > > > Attempting to add a property to a class using
        > > > CodePropertySet ValueReferenceE xpression to add the set statement does not add
        > > > (byval value as <type>) so using te property fails. Any ideas?
        > > >
        > > > MikeG[/color][/color][/color]

        Comment

        • Ronchese

          #5
          Re: VB.NET codeDom

          Who access that method? A external program. If yes, change the modifier of
          your method to Public.

          Also, check if Me.IntegerField is a public property or public variable.


          []s
          Cesar




          "MikeG" <MikeG@discussi ons.microsoft.c om> wrote in message
          news:9207A452-B0A5-4ADB-BE7C-0746C8E7BF8B@mi crosoft.com...
          Sorry the actual code produced is:

          Private Property integerProperty as system.void
          Get
          Return Me.integerField
          End Get
          Set
          Me.integerField = value
          End Set
          End Property

          whereas it should be

          Private Property integerProperty () As Integer
          Get
          Return Me.integerField
          End Get
          Set(ByVal Value As Integer)
          Me.integerField = value
          End Set
          End Property

          Thanks,

          MikeG

          "MikeG" wrote:
          [color=blue]
          > Thanks Naveen,
          >
          > I dont get an error as such, the property is created as
          >
          > Private Property integerProperty () As Integer
          > Get
          > Return Me.integerField
          > End Get
          > Set
          > Me.integerField = value
          > End Set
          > End Property
          >
          > whereas it should be
          >
          > Private Property integerProperty () As Integer
          > Get
          > Return Me.integerField
          > End Get
          > Set(ByVal Value As Integer)
          > Me.integerField = value
          > End Set
          > End Property
          >
          > and so the application created does not work and it returns the error
          >
          > "System.Missing MethodException : Method not found: Void
          > LEATESTNamespac e.cLEADataEntit y.set_name(Syst em.String)."
          >
          > Regards,
          >
          > MikeG
          >
          >
          > "Naveen" wrote:
          >[color=green]
          > >
          > > Hi Mike..
          > >
          > > What error you are getting ? There is an excellent example on MSDN which
          > > helps you for this...
          > >
          > >[/color][/color]
          http://msdn.microsoft.com/library/de...ClassTopic.asp[color=blue][color=green]
          > >
          > > HTH
          > >
          > > With Best Regards
          > > Naveen K S
          > >
          > > "MikeG" wrote:
          > >[color=darkred]
          > > > Attempting to add a property to a class using
          > > > CodePropertySet ValueReferenceE xpression to add the set statement does[/color][/color][/color]
          not add[color=blue][color=green][color=darkred]
          > > > (byval value as <type>) so using te property fails. Any ideas?
          > > >
          > > > MikeG[/color][/color][/color]


          Comment

          • MikeG

            #6
            Re: VB.NET codeDom

            I am closing this call as I have since discovered that the compiled code
            produced runs and while the source code generated does not have the (value as
            <datatype>) line, this does not appear to matter.

            Thanks everyone.

            MikeG

            "Ronchese" wrote:
            [color=blue]
            > Who access that method? A external program. If yes, change the modifier of
            > your method to Public.
            >
            > Also, check if Me.IntegerField is a public property or public variable.
            >
            >
            > []s
            > Cesar
            >
            >
            >
            >
            > "MikeG" <MikeG@discussi ons.microsoft.c om> wrote in message
            > news:9207A452-B0A5-4ADB-BE7C-0746C8E7BF8B@mi crosoft.com...
            > Sorry the actual code produced is:
            >
            > Private Property integerProperty as system.void
            > Get
            > Return Me.integerField
            > End Get
            > Set
            > Me.integerField = value
            > End Set
            > End Property
            >
            > whereas it should be
            >
            > Private Property integerProperty () As Integer
            > Get
            > Return Me.integerField
            > End Get
            > Set(ByVal Value As Integer)
            > Me.integerField = value
            > End Set
            > End Property
            >
            > Thanks,
            >
            > MikeG
            >
            > "MikeG" wrote:
            >[color=green]
            > > Thanks Naveen,
            > >
            > > I dont get an error as such, the property is created as
            > >
            > > Private Property integerProperty () As Integer
            > > Get
            > > Return Me.integerField
            > > End Get
            > > Set
            > > Me.integerField = value
            > > End Set
            > > End Property
            > >
            > > whereas it should be
            > >
            > > Private Property integerProperty () As Integer
            > > Get
            > > Return Me.integerField
            > > End Get
            > > Set(ByVal Value As Integer)
            > > Me.integerField = value
            > > End Set
            > > End Property
            > >
            > > and so the application created does not work and it returns the error
            > >
            > > "System.Missing MethodException : Method not found: Void
            > > LEATESTNamespac e.cLEADataEntit y.set_name(Syst em.String)."
            > >
            > > Regards,
            > >
            > > MikeG
            > >
            > >
            > > "Naveen" wrote:
            > >[color=darkred]
            > > >
            > > > Hi Mike..
            > > >
            > > > What error you are getting ? There is an excellent example on MSDN which
            > > > helps you for this...
            > > >
            > > >[/color][/color]
            > http://msdn.microsoft.com/library/de...ClassTopic.asp[color=green][color=darkred]
            > > >
            > > > HTH
            > > >
            > > > With Best Regards
            > > > Naveen K S
            > > >
            > > > "MikeG" wrote:
            > > >
            > > > > Attempting to add a property to a class using
            > > > > CodePropertySet ValueReferenceE xpression to add the set statement does[/color][/color]
            > not add[color=green][color=darkred]
            > > > > (byval value as <type>) so using te property fails. Any ideas?
            > > > >
            > > > > MikeG[/color][/color]
            >
            >
            >[/color]

            Comment

            Working...