Click here to Skip to main content
15,878,945 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dynamic table insert issue with dates Pin
OriginalGriff17-Nov-22 8:40
mveOriginalGriff17-Nov-22 8:40 
AnswerRe: Dynamic table insert issue with dates Pin
Richard Deeming17-Nov-22 21:37
mveRichard Deeming17-Nov-22 21:37 
QuestionMicrosoft.Practices.Composite.Presentation.Events Pin
Kevin Marois16-Nov-22 12:14
professionalKevin Marois16-Nov-22 12:14 
AnswerRe: Microsoft.Practices.Composite.Presentation.Events Pin
Dave Kreskowiak16-Nov-22 12:49
mveDave Kreskowiak16-Nov-22 12:49 
AnswerRe: Microsoft.Practices.Composite.Presentation.Events Pin
Richard Deeming16-Nov-22 21:31
mveRichard Deeming16-Nov-22 21:31 
QuestionI'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Rakos4613-Nov-22 10:46
Rakos4613-Nov-22 10:46 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Mycroft Holmes13-Nov-22 11:06
professionalMycroft Holmes13-Nov-22 11:06 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
OriginalGriff13-Nov-22 18:53
mveOriginalGriff13-Nov-22 18:53 
Since we have no idea where in that code the problem is being reported, we pretty much have to guess.
In this case, it's probably this line:
C#
if (NameVar.Length > 12);
The semicolon ends the statement, so the following code block will be executed regardless of the if condition.

If you had indented your code properly - and Visual Studio will do that for you - =that would have been pretty obvious!

You should expect to get syntax errors every day, probably many times a day while you are coding - we all do regardless of how much experience we have! Sometimes, we misspell a variable, or a keyword; sometimes we forget to close a string or a code block. Sometimes the cat walks over your keyboard and types something really weird. Sometimes we just forget how many parameters a method call needs.

We all make mistakes.

And because we all do it, we all have to fix syntax errors - and it's a lot quicker to learn how and fix them yourself than to wait for someone else to fix them for you! So invest a little time in learning how to read error messages, and how to interpret your code as written in the light of what the compiler is telling you is wrong - it really is trying to be helpful!

So read this: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[^] - it should help you next time you get a compilation error!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Calin Negru14-Nov-22 3:28
Calin Negru14-Nov-22 3:28 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Victor Nijegorodov14-Nov-22 3:40
Victor Nijegorodov14-Nov-22 3:40 
QuestionMy Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil9-Nov-22 17:45
Radheya Patil9-Nov-22 17:45 
AnswerRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
OriginalGriff9-Nov-22 18:48
mveOriginalGriff9-Nov-22 18:48 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 1:05
Radheya Patil10-Nov-22 1:05 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Richard Deeming10-Nov-22 1:24
mveRichard Deeming10-Nov-22 1:24 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 1:42
Radheya Patil10-Nov-22 1:42 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Richard Deeming10-Nov-22 2:00
mveRichard Deeming10-Nov-22 2:00 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 16:37
Radheya Patil10-Nov-22 16:37 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
jsc4210-Nov-22 5:08
professionaljsc4210-Nov-22 5:08 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 16:39
Radheya Patil10-Nov-22 16:39 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
OriginalGriff10-Nov-22 20:18
mveOriginalGriff10-Nov-22 20:18 
QuestionRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Eddy Vluggen11-Nov-22 6:37
professionalEddy Vluggen11-Nov-22 6:37 
AnswerRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Gerry Schmitz11-Nov-22 6:46
mveGerry Schmitz11-Nov-22 6:46 
QuestionNet framework again Pin
Calin Negru8-Nov-22 7:59
Calin Negru8-Nov-22 7:59 
AnswerRe: Net framework again Pin
OriginalGriff8-Nov-22 10:05
mveOriginalGriff8-Nov-22 10:05 
GeneralRe: Net framework again Pin
Calin Negru8-Nov-22 22:01
Calin Negru8-Nov-22 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.