vb.net - None Shared member requires an object reference -
i'm having problem because changed code vb6
.net
, cant seem sort out issue having. please assist.
the error message i'm getting:
error 5 reference non-shared member requires object reference.
this happening quite few places in code. code. problem says frminvitem.inv.`
option strict off option explicit on public class clsinv
public function runprocess(byval connectstr string, byref parstr string) integer dim frminvit frminvitem runprocess = frminvitem.inv(connectstr, parstr) frminvit.close() end function
i assume inv
not shared, calling without instance of class in is. either have make shared
or create instance of frminvitem
:
dim frminvit new frminvitem() ' create instance runprocess = frminvit.inv(connectstr, parstr) ' use on instance
frminvitem
class, can call method via classname if method shared
.
shared
procedures class methods not associated specific instance of class. example,cos
method defined withinmath
class shared method. can call shared procedure method of object or directly class.
Comments
Post a Comment