Why can't I find my method?

  • Thread starter Thread starter Aaron Ackerman
  • Start date Start date
A

Aaron Ackerman

I have a very simple "test" business layer and a very simple data layer. in
the data layer I have a simple public method. I import the reference of the
data layer (Imports MyDataLayer), and now I can create my object:

Dim MyObj as New DataClass

But when I try to access the public method:

MyObj.MyMethod

I get the following error if i hover over the object:

Declaration expected. I don't get it? Intellisense sees the Datalayer and
the class. I declare it correctly but I cannot get to the method because it
says it is not declared??????
 
Aaron Ackerman said:
I have a very simple "test" business layer and a very simple data
layer. in the data layer I have a simple public method. I import the
reference of the data layer (Imports MyDataLayer), and now I can
create my object:

Dim MyObj as New DataClass

But when I try to access the public method:

MyObj.MyMethod

I get the following error if i hover over the object:

Declaration expected. I don't get it? Intellisense sees the Datalayer
and the class. I declare it correctly but I cannot get to the method
because it says it is not declared??????

In which procedure is
MyObj.MyMethod
located?
 
* "Aaron Ackerman said:
I have a very simple "test" business layer and a very simple data layer. in
the data layer I have a simple public method. I import the reference of the
data layer (Imports MyDataLayer), and now I can create my object:

Dim MyObj as New DataClass

But when I try to access the public method:

MyObj.MyMethod

I get the following error if i hover over the object:

Declaration expected. I don't get it? Intellisense sees the Datalayer and
the class. I declare it correctly but I cannot get to the method because it
says it is not declared??????

What's the modifier of the method 'MyMethod'? Is it 'Public' or
'Friend'? Is there maybe a typo in the name of the method? What does
IntelliSense show?
 
I said it was public.

Herfried K. Wagner said:
What's the modifier of the method 'MyMethod'? Is it 'Public' or
'Friend'? Is there maybe a typo in the name of the method? What does
IntelliSense show?
 
Dim MyObj as New DataClass
But when I try to access the public method:

MyObj.MyMethod

I get the following error if i hover over the object:

Declaration expected.

Just guessing...

Do you have any other DataClass classes in your project, in other
namespaces? Maybe you only think that you instantiate MyDataLayer.DataClass,
while you instantiate SomeOtherNamespace.DataClass?

A copy-paste of your code would help to find the problem.

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
************************************
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
 
Back
Top