R
R Reyes
I have a public class called Database.cs. It has public static functions and
I call them from ProjectA. The code looks something like:
int intConnectionSuccessful = Database.ConnectToDatabase();
Works great.
Now, I have another project, ProjectB on a different server. I copy and add
Database.cs to the project and also call the functions the exact same way as
above. However, I always get this error message:
'The name 'Database' does not exist in the current context'
OR
The type or namespace name 'Database' could not be found (are you missing a
using directive or an assembly reference?)
The file is added to the project and the code is exactly the same except it
works in ProjectA and not in ProjectB. I've compared the files and even the
way they are used in each project to match them up but no matter what I can't
get it to work in ProjectB. I've tried manually retyping everything as well
as copying files for duplication.
I can't seem to replicate the working version even when creating a new
project and starting from scratch. I'm guessing there is either some
configuration setting I missed or the file has to be referenced in a specific
way.
If possible could someone list the exact steps to make this work like I have
it in ProjectA? Or have any ideas why it doesn't work? The only difference
is that one project is made in Visual Web Developer 2008 Express and the
working version is made in Visual Studio 2005
Please help. Thanks in advance.
I call them from ProjectA. The code looks something like:
int intConnectionSuccessful = Database.ConnectToDatabase();
Works great.
Now, I have another project, ProjectB on a different server. I copy and add
Database.cs to the project and also call the functions the exact same way as
above. However, I always get this error message:
'The name 'Database' does not exist in the current context'
OR
The type or namespace name 'Database' could not be found (are you missing a
using directive or an assembly reference?)
The file is added to the project and the code is exactly the same except it
works in ProjectA and not in ProjectB. I've compared the files and even the
way they are used in each project to match them up but no matter what I can't
get it to work in ProjectB. I've tried manually retyping everything as well
as copying files for duplication.
I can't seem to replicate the working version even when creating a new
project and starting from scratch. I'm guessing there is either some
configuration setting I missed or the file has to be referenced in a specific
way.
If possible could someone list the exact steps to make this work like I have
it in ProjectA? Or have any ideas why it doesn't work? The only difference
is that one project is made in Visual Web Developer 2008 Express and the
working version is made in Visual Studio 2005
Please help. Thanks in advance.