mysterious compile error, method which exists isn't found

J

Jeff

hi

asp.net 3.5

The second line in the code below generates a compile error:
'Car' does not contain a definition for 'GetCar'

long id = Convert.ToInt64(Request.QueryString["id"].ToString());
Car car = Car.GetCar(id);

this happens inside an .aspx webpage, Car is a class in the BLL layer, the
code above is in the Page_Load on the webpage. Above this code I'm having
"using me.carspace.BLL;"

But the GetCar method exists in the Car class, I've used this code from
another webpage without any trouble. (only difference is that this page
don't have any masterpage, I don't see how that can make the problem)

This is the signature for GetCar:
public static Car GetCar(long id)

When I in the Page_Load event type "Car." then the intellisense suggest
"GetCar" but I get compile error when using it.

This .aspx webpage is located in the root folder

I don't see how this can be a reference problem, as all the classes are
inside this webproject and at the top of this .aspx.cs file I referecing the
BLL class ("using me.carspace.BLL;")

any ideas what's wrong here?
 
M

Mr. Arnold

Jeff said:
hi

asp.net 3.5

The second line in the code below generates a compile error:
'Car' does not contain a definition for 'GetCar'

long id = Convert.ToInt64(Request.QueryString["id"].ToString());
Car car = Car.GetCar(id);

this happens inside an .aspx webpage, Car is a class in the BLL layer, the
code above is in the Page_Load on the webpage. Above this code I'm having
"using me.carspace.BLL;"

But the GetCar method exists in the Car class, I've used this code from
another webpage without any trouble. (only difference is that this page
don't have any masterpage, I don't see how that can make the problem)

This is the signature for GetCar:
public static Car GetCar(long id)

When I in the Page_Load event type "Car." then the intellisense suggest
"GetCar" but I get compile error when using it.

This .aspx webpage is located in the root folder

I don't see how this can be a reference problem, as all the classes are
inside this webproject and at the top of this .aspx.cs file I referecing
the BLL class ("using me.carspace.BLL;")

any ideas what's wrong here?

The method is not in the namespace you think it is? So, it can't be found?


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4142 (20090609) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
J

Jeff

I've solved it, I had another .aspx webpage in the same folder with the name
Car, so I solved it by referencing the Car class by me.carspace.BLL.Car


Mr. Arnold said:
Jeff said:
hi

asp.net 3.5

The second line in the code below generates a compile error:
'Car' does not contain a definition for 'GetCar'

long id = Convert.ToInt64(Request.QueryString["id"].ToString());
Car car = Car.GetCar(id);

this happens inside an .aspx webpage, Car is a class in the BLL layer,
the code above is in the Page_Load on the webpage. Above this code I'm
having
"using me.carspace.BLL;"

But the GetCar method exists in the Car class, I've used this code from
another webpage without any trouble. (only difference is that this page
don't have any masterpage, I don't see how that can make the problem)

This is the signature for GetCar:
public static Car GetCar(long id)

When I in the Page_Load event type "Car." then the intellisense suggest
"GetCar" but I get compile error when using it.

This .aspx webpage is located in the root folder

I don't see how this can be a reference problem, as all the classes are
inside this webproject and at the top of this .aspx.cs file I referecing
the BLL class ("using me.carspace.BLL;")

any ideas what's wrong here?

The method is not in the namespace you think it is? So, it can't be found?


__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4142 (20090609) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
G

Guest

I've solved it, I had another .aspx webpage in the same folder with the name
Car, so I solved it by referencing the Car class by me.carspace.BLL.Car



Jeff said:
hi
asp.net 3.5
The second line in the code below generates a compile error:
'Car' does not contain a definition for 'GetCar'
long id = Convert.ToInt64(Request.QueryString["id"].ToString());
Car car = Car.GetCar(id);
this happens inside an .aspx webpage, Car is a class in the BLL layer,
the code above is in the Page_Load on the webpage. Above this code I'm
having
"using me.carspace.BLL;"
But the GetCar method exists in the Car class, I've used this code from
another webpage without any trouble. (only difference is that this page
don't have any masterpage, I don't see how that can make the problem)
This is the signature for GetCar:
public static Car GetCar(long id)
When I in the Page_Load event type "Car." then the intellisense suggest
"GetCar" but I get compile error when using it.
This .aspx webpage is located in the root folder
I don't see how this can be a reference problem, as all the classes are
inside this webproject and at the top of this .aspx.cs file I referecing
the BLL class ("using me.carspace.BLL;")
any ideas what's wrong here?
The method is not in the namespace you think it is? So, it can't be found?
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4142 (20090609) __________
The message was checked by ESET NOD32 Antivirus.

Yes, it can happen. Avoid using class names that duplicate names of
other classes or commonly used .NET Framework namespaces.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top