Click here to Skip to main content
15,887,476 members
Home / Discussions / C#
   

C#

 
GeneralRe: TCP Server Multiple Clients (Server Initiation Connection) Pin
MooKowMyke9-Jun-15 9:04
MooKowMyke9-Jun-15 9:04 
QuestionHelp using EF with DB2 Pin
USAFHokie804-Jun-15 2:56
USAFHokie804-Jun-15 2:56 
AnswerRe: Help using EF with DB2 Pin
Richard MacCutchan4-Jun-15 4:29
mveRichard MacCutchan4-Jun-15 4:29 
QuestionC# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 2:24
Setasigge4-Jun-15 2:24 
AnswerRe: C# Newbie. Need help on coding a errorcheck Pin
Eddy Vluggen4-Jun-15 2:59
professionalEddy Vluggen4-Jun-15 2:59 
AnswerRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan4-Jun-15 4:27
mveRichard MacCutchan4-Jun-15 4:27 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 21:04
Setasigge4-Jun-15 21:04 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan4-Jun-15 21:37
mveRichard MacCutchan4-Jun-15 21:37 
No, nothing wrong with that, the error is in the ErrorCheck method, which I missed before. Your tests will set isError to true if any of the text boxes are not valid. However, the last test is a problem, if txtboxEmail contains some text then it goes to the else clause and sets isError to false, thus negating any previous test which set it to true. You should either change it to use else if clauses like this:
C#
bool isError;

if(txtboxName.Text.Trim().Length == 0)
{
    MessageBox.Show("Anna nimesi!", "Seis!", MessageBoxButton.OK, MessageBoxImage.Error);
    isError = true;
}

else if (txtboxBday.Text.Trim().Length == 0)
{
    MessageBox.Show("Anna Syntymäaikasi", "Seis!", MessageBoxButton.OK, MessageBoxImage.Error);
    isError = true;
}

else if (txtboxPhone.Text.Trim().Length == 0)
{
    MessageBox.Show("Anna Puhelinnumerosi!", "Seis!", MessageBoxButton.OK, MessageBoxImage.Error);
    isError = true;
}


else if (txtboxAddress.Text.Trim().Length == 0)
{
    MessageBox.Show("Anna Osoitteesi", "Seis!", MessageBoxButton.OK, MessageBoxImage.Error);
    isError = true;
}

else if (txtboxEmail.Text.Trim().Length == 0)
{
    MessageBox.Show("Anna S-postisi!", "Seis!", MessageBoxButton.OK, MessageBoxImage.Error);
    isError = true;
}

else
{
    isError = false;
}
return isError;

, or set isError to false at the beginning of the method, and remove the final else clause.
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 22:01
Setasigge4-Jun-15 22:01 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan5-Jun-15 0:27
mveRichard MacCutchan5-Jun-15 0:27 
QuestionImplementing PocketSphinx in C# Pin
Member 105130663-Jun-15 21:14
Member 105130663-Jun-15 21:14 
AnswerREPOST Pin
Richard Deeming3-Jun-15 21:32
mveRichard Deeming3-Jun-15 21:32 
GeneralRe: REPOST Pin
Member 105130663-Jun-15 21:54
Member 105130663-Jun-15 21:54 
SuggestionRe: Implementing PocketSphinx in C# Pin
Richard MacCutchan3-Jun-15 21:35
mveRichard MacCutchan3-Jun-15 21:35 
AnswerRe: Implementing PocketSphinx in C# Pin
Simon_Whale3-Jun-15 22:25
Simon_Whale3-Jun-15 22:25 
AnswerRe: Implementing PocketSphinx in C# Pin
Pete O'Hanlon3-Jun-15 22:31
mvePete O'Hanlon3-Jun-15 22:31 
QuestionFresher problem for getting job in asp.net? Pin
Andyweil223-Jun-15 16:58
Andyweil223-Jun-15 16:58 
AnswerRe: Fresher problem for getting job in asp.net? Pin
Richard MacCutchan3-Jun-15 21:40
mveRichard MacCutchan3-Jun-15 21:40 
AnswerRe: Fresher problem for getting job in asp.net? Pin
OriginalGriff3-Jun-15 22:30
mveOriginalGriff3-Jun-15 22:30 
QuestionHow to not display the a row based on a condition. Pin
Norris Chappell3-Jun-15 14:39
Norris Chappell3-Jun-15 14:39 
AnswerRe: How to not display the a row based on a condition. Pin
PIEBALDconsult3-Jun-15 14:47
mvePIEBALDconsult3-Jun-15 14:47 
GeneralRe: How to not display the a row based on a condition. Pin
Norris Chappell4-Jun-15 4:21
Norris Chappell4-Jun-15 4:21 
AnswerRe: How to not display the a row based on a condition. Pin
Mathi Mani3-Jun-15 15:54
Mathi Mani3-Jun-15 15:54 
GeneralRe: How to not display the a row based on a condition. Pin
Norris Chappell4-Jun-15 3:54
Norris Chappell4-Jun-15 3:54 
QuestionRe: How to not display the a row based on a condition. Pin
Agent__0073-Jun-15 18:41
professionalAgent__0073-Jun-15 18:41 

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.