Reference to a non-shared member requires object reference.
-
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
-
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
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.
-
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.
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
-
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
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 asShared
and theMe.
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