|
-
Aug 21st, 2006, 04:30 AM
#1
Thread Starter
Addicted Member
I follow tutorials word for word but I still get build errors...
I keep doing tutorials and typing stuff out word for word but I always get build errors and I keep having to leave it and go onto the next because I can't fix it myself. I've just followed a video tutorial and watched the guy write it all out, so I copied it, and I got errors.
Errors are as follows:
Error 1 The best overloaded method match for 'int.Parse(string)' has some invalid arguments C:\Websites\Begin\Chapter10\SimpleUserControl\Global.asax 39 25 C:\...\SimpleUserControl\
Error 2 Argument '1': cannot convert from 'method group' to 'string' C:\Websites\Begin\Chapter10\SimpleUserControl\Global.asax 39 35 C:\...\SimpleUserControl\
The errors referred to this piece of code:
void Session_End(object sender, EventArgs e)
{
int userCount = int.Parse(Application.Get("userCount").ToString);
userCount--;
Application.Set("userCount", userCount);
}
The best bit is I have the exact same code in the Session_Start and there are no errors, but I can't see any difference. What is wrong with that?
Thanks in advance
-
Aug 21st, 2006, 04:34 AM
#2
Thread Starter
Addicted Member
Re: I follow tutorials word for word but I still get build errors...
What a pile of poo. I just cut it and pasted it back in and now it works - why would it do that? As if it's not hard enough to learn without errors they go and put some in that aren't even proper ones.
-
Aug 21st, 2006, 04:37 AM
#3
Re: I follow tutorials word for word but I still get build errors...
Code:
int userCount = int.Parse(Application.Get("userCount").ToString);
You're missing the argument parentheses after ToString. Without them, it is a reference to the ToString method. With them, you are calling the ToString method.
Microsoft don't put errors in deliberately, they have enough as it is.
-
Aug 21st, 2006, 04:39 AM
#4
Thread Starter
Addicted Member
Re: I follow tutorials word for word but I still get build errors...
What's annoying is I put them in after I compared it to the line in the Session_Start which was working, but the errors remained when I tried to run. Then cutting and pasting it back worked.
Thanks for your help and quick response.
-
Aug 21st, 2006, 04:41 AM
#5
Re: I follow tutorials word for word but I still get build errors...
Sometimes you have to manually build it before running, by pressing F6 (then F5).
-
Aug 21st, 2006, 04:44 AM
#6
Thread Starter
Addicted Member
Re: I follow tutorials word for word but I still get build errors...
Ah ok, thanks, I didn't know about that one
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|