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 within math class shared method. can call shared procedure method of object or directly class.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -