Solved

Accessing a seperate class from another class

Posted on 2007-03-20
5
197 Views
Last Modified: 2011-09-20
This is a really easy question, but for some reason i cant seem to figure it out....

I have my Default.aspx page with the .cs code-behind that runs some methods. I also have another class in the App_Code folder called DataAccess.cs that has some public methods that i want to call in my Default.aspx.cs page, but i cant seem to access the class.

Any help?
0
Comment
Question by:dtddev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 18759158
for instance methods:

DataAccess da = new DataAccess();
da.RunMethod();

for static methods:
DataAccess.RunStaticMethod();

make sure the class is declared public as well
0
 

Author Comment

by:dtddev
ID: 18759291
right the only problem is that when i Type in DataAccess, it does not come up in the Intellisense
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 18759303
Can you post the contests of DataAccess (or at least the class and method definitions - you don;t need to include the code within the methods)?
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 18759309
I'm thinking it's either a namespace issue or a visibility issue (is it "class DataAccess" or "public class DataAccess")
0
 

Author Comment

by:dtddev
ID: 18759341
AH HA. i figure it out.... wow i feel stupid. I named the class DataAccess.cs but the actuall class name was sqlDataAccess..........

Thanks for your help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question