DOH!!!
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
The ; at the end of MessabeBox.Show
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein -
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
Kevin Marois wrote:
the user click No when asked to confirm, it still deleted the row
While setting up my Mac, it presents you with a EULA. The two buttons were:
[Shut Down] [Agree]
:laugh:
Kevin Marois wrote:
Can you spot the bug?
Unfortunate placement of an extra semicolon. :)
-
The ; at the end of MessabeBox.Show
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert EinsteinYup! I hate the fact that the compiler lets that through!! :mad::mad:
If it's not broken, fix it until it is
-
Kevin Marois wrote:
the user click No when asked to confirm, it still deleted the row
While setting up my Mac, it presents you with a EULA. The two buttons were:
[Shut Down] [Agree]
:laugh:
Kevin Marois wrote:
Can you spot the bug?
Unfortunate placement of an extra semicolon. :)
yaaa. Damn stupid compiler ;P
If it's not broken, fix it until it is
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
Ouch!
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. Stephen Hawking
-
Yup! I hate the fact that the compiler lets that through!! :mad::mad:
If it's not broken, fix it until it is
yeah, a blank statement should not be allowed as the target of an if
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein -
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
The semi-colon at end of if, I consider that a tired mistake. You're coding like crazy and you're getting a lot done but getting tired and doh!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
:doh: Been there, done that. :beer: time.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ; // One statement due to ;
{ // Second statement.
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; }
}
It happens sometimes such cranky bugs.
Wonde Tadesse
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
Was the semi colon put in accidentally after all the code was written, or did the VS editor formatted the braces in place for the IF condition in spite of the semi colon? :omg:
"Real men drive manual transmission" - Rajesh.
-
:doh: Been there, done that. :beer: time.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Chris Maunder wrote:
[beer] time.
Schmiddy of light?
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
It's terrible when your semi colon ends up dangling.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
without having looked at the previous answers I say just remove the ";" at the end of the if statement. subtle. ;)
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
-
Chris Maunder wrote:
[beer] time.
Schmiddy of light?
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
_Josh_ wrote:
Shandy
He's not going to be able to only target me now, you'll have to be in his sights.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
This isn't a programming question. I wrote this, and just did a DOH!! Can you spot the bug? QA submitted a ticket say that when the Delete Account button was clicked, and the user click No when asked to confirm, it still deleted the row.
private void DeleteSelectedRows()
{
if (accountsUltraGrid.Selected.Rows.Count > 0)
{
string message = "Are you sure you want to delete the selected accounts?";
if (MessageBox.Show(message, "Delete Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
{
foreach (var gridRow in accountsUltraGrid.Selected.Rows)
{
Account account = gridRow.ListObject as Account;host.GetProxy().DeleteAccount(account); totalRowCount--; } } }
}
If it's not broken, fix it until it is
-
That might be because there is no MessageBox.ShowDialog method... :-D
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water