473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to use my class from another class (.Net 2005)

hi

how to use my class from another class (.Net 2005)

i have web project (one page)

and created a class MyClass in separate file, the same folder, included in
project.

when i'm call MyClass in that web page... it dosn't see it.

thank you
Feb 8 '06 #1
4 3851
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?

Feb 8 '06 #2
i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing a
using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--
Sergiy Klokov
c. +1 602 703-4287
Skype ( edgerunner2005 )
Yahoo Messenger ( edgerunner2005 )

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?


Feb 8 '06 #3
It's a basic checking:

1. The namespace of both class are the same?
2. If not, are you placing the complete name of second class in the first
class call?
3. This is the only error? As Bruce said, you can have a compilation error
in this second class that makes the first class error happens...

"Serdge Kooleman" <Su***@web.de> wrote in message
news:uI*************@TK2MSFTNGP15.phx.gbl...
i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing
a using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--
Sergiy Klokov
c. +1 602 703-4287
Skype ( edgerunner2005 )
Yahoo Messenger ( edgerunner2005 )

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
When you say "it doesn't see it", what do you mean?

Do you get a compiler error? What's the error? Could you post the code
for MyClass so we can see it?

Or does it compile OK but you get a run-time error? What's the error?


Feb 8 '06 #4
file was in root folder.
when i put it in the App_Code it started to compile

thank you

--
It's a basic checking:

1. The namespace of both class are the same?
2. If not, are you placing the complete name of second class in the first
class call?
3. This is the only error? As Bruce said, you can have a compilation error
in this second class that makes the first class error happens...

i'm getting compiler error.

"The type or namespace name 'MyClass' could not be found (are you missing
a using directive or an assembly reference?) "

two .cs files, when i use class name in another file, it doesn't work.
(blue line under the class name, and compiler error)

--

Feb 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stewart Midwinter | last post by:
I've got an app that creates an object in its main class (it also creates a GUI). My problem is that I need to pass this object, a list, to a dialog that is implemented as a second class. I want...
11
by: Bob Rock | last post by:
Hello, I'd like to be able to allow instanciation of a class (class Class_A) only from another class method (class Class_B). And I'd like to write the necessary code to enforce this behavior...
6
by: SearedIce | last post by:
Consider the following simplified hypothetical code: #include <iostream.h> class rabbit { public: rabbit() {x = 3; y = 3; /*code here to set field to 1*/} void runtocage(); int x;
4
by: Al Murphy | last post by:
I have a windows application called "WindowsApplication1". I have a variable of tyoe DataSet called myDataSet as shown below: namespace WindowsApplication1 { public class Form1 :...
5
by: M O J O | last post by:
Hi, I want to expose a enum from another class, is that possible and how? Here's an example Public Class ClassMaster Public Enum Colors
29
by: Michael D. Ober | last post by:
Is there any way to create a constant in a class that can be used both with an instantiated object and without. For example: dim ClassConst as string = myClass.ConstantString dim myObj = new...
4
by: Steve Goldman | last post by:
Even asking this question probably demonstrates that I have a fundamental misunderstanding of how values and references work in C#, but here goes: I'd like to assign a reference to an arbitrary...
3
by: drummond.ian | last post by:
Hello Everyone, This problem's been causing me a lot of trouble and I'm hoping somebody can help me out!! I have a dialog-based MFC application in visual studio 2003. I want to call a...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.