Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Reference to a non-shared member requires object reference.

Reference to a non-shared member requires object reference.

Scheduled Pinned Locked Moved Visual Basic
helpjava
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NasimKaziS
    wrote on last edited by
    #1

    Hi, Am trying to access a web sevice developed in java, but i get the below error. "Reference to a non-shared member requires object reference." can anyone help on this.. Thanks in advance

    where there is a will there is a way

    C 1 Reply Last reply
    0
    • N NasimKaziS

      Hi, Am trying to access a web sevice developed in java, but i get the below error. "Reference to a non-shared member requires object reference." can anyone help on this.. Thanks in advance

      where there is a will there is a way

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      The message is clear

      NasimKaziS wrote:

      Reference to a non-shared member requires object reference."

      you need an instance of the object in order to access a non-shared member. Maybe some code post will help us (and you). :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      N 1 Reply Last reply
      0
      • C CPallini

        The message is clear

        NasimKaziS wrote:

        Reference to a non-shared member requires object reference."

        you need an instance of the object in order to access a non-shared member. Maybe some code post will help us (and you). :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        N Offline
        N Offline
        NasimKaziS
        wrote on last edited by
        #3

        code used: Imports WSDemo.demoref Public Class Form2 Dim mservice As New MTVAS Dim basicDesc As New BCDT() Dim mn As New TVAMT Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load mn.originID = "test" mservice.importTVAO(mn) End Sub End Class Error: Reference to a non-shared member requires an object reference. If i double click on the error it takes me to the Reference.vb file underlined code as below _ Public Property preferenceValue() As String Get Return Me.preferenceValueField End Get Set Me.preferenceValueField = value End Set End Property End Class The first statement of the above code is highlighted. Hope this helps ------------------------------

        where there is a will there is a way

        C 1 Reply Last reply
        0
        • N NasimKaziS

          code used: Imports WSDemo.demoref Public Class Form2 Dim mservice As New MTVAS Dim basicDesc As New BCDT() Dim mn As New TVAMT Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load mn.originID = "test" mservice.importTVAO(mn) End Sub End Class Error: Reference to a non-shared member requires an object reference. If i double click on the error it takes me to the Reference.vb file underlined code as below _ Public Property preferenceValue() As String Get Return Me.preferenceValueField End Get Set Me.preferenceValueField = value End Set End Property End Class The first statement of the above code is highlighted. Hope this helps ------------------------------

          where there is a will there is a way

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          NasimKaziS wrote:

          preferenceValueField

          Is this an instance field, or a shared field. You use it as an instance field. However, the compiler error indicates it is actaully a shared field. So, it should either be an instance field (remove the Shared keyword from its definition) OR the property needs to be marked as Shared and the Me. in the getter and setter need to be removed.


          Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups