gRoberts12
Newcomer
- Joined
- Aug 5, 2005
- Messages
- 7
Hey peeps,
I've got a situation where I need some help if possible.
I've got my class setup, and i've told it to create a method:
Now when the user log's in, I want to be able to store their user details into an array of which I can access through-out my pages.
But for some weird reason, my main aspx page see's the class, and will act upon onLoad methods etc, but when I call UserDetails() it says it can't find it, even if I do this:
EYCDWEB.Generic Bob = new EYCDWEB.Generic();
Bob.UserDetails();
can anyone shed some light on why my methods are not public, i'm getting the following error when I try:
'what i'm trying to call' does not exist in the current context
Cheers
Gav
I've got a situation where I need some help if possible.
I've got my class setup, and i've told it to create a method:
Code:
private void UserDetails()
{
if(Session["User"] != null)
{
SqlConnection UserDetails_Connection = new SqlConnection("server=xx.xxx.xxx.xx;uid=xxxxxx;pwd=xxxxx;database=xxxxxx");
SqlCommand UserDetails_Command = new SqlCommand("SELECT * FROM Users WHERE Username like '" + Session["User"] + "'",UserDetails_Connection);
try
{
UserDetails_Connection.Open();
UserDetails_Read = UserDetails_Command.ExecuteReader();
UserDetails_Read.Read();
UserDetail.Add(UserDetails_Read.GetInt32(0));
UserDetail.Add(UserDetails_Read.GetValue(1));
}
catch(Exception Ex)
{
Response.Write(Ex.Message);
}
finally
{
UserDetails_Read.Close();
UserDetails_Connection.Close();
}
}
UserDetails_Arr = UserDetail.ToArray();
}
Now when the user log's in, I want to be able to store their user details into an array of which I can access through-out my pages.
But for some weird reason, my main aspx page see's the class, and will act upon onLoad methods etc, but when I call UserDetails() it says it can't find it, even if I do this:
EYCDWEB.Generic Bob = new EYCDWEB.Generic();
Bob.UserDetails();
can anyone shed some light on why my methods are not public, i'm getting the following error when I try:
'what i'm trying to call' does not exist in the current context
Cheers
Gav