What this means is that the above statement is pointless and does nothing. Perhaps you were expecting the line above to make execution of the following code block conditional on txt1.Text.Length being positive. However, with the code as you have written it, the following block gets executed unconditionally, always:
StewarA
Member
15 Points
3 Posts
possble mistaken empty statement
Jun 15, 2006 05:38 PM|LINK
can anyone help me with this? I did a search and found nothing. I searched MSDN and found nothing.
protected void BtnUpdate_Click(object sender, EventArgs e) { TextBox txt1 = new TextBox(); TextBox txt2 = new TextBox(); Int32 i = 0; Int16 i2 = 0; Double dk = 0; string s = ""; int i3 = 0; foreach(GridViewRow row in GridView1.Rows) { i = row.RowIndex; //GridView1.EditIndex = GridView1.SelectedIndex; txt1 = (TextBox)GridView1.Rows[i].FindControl("tboxNewPercentage"); if (txt1.Text.Length > 0) ; // <== creates "possible mistaken empty statement" { dk = Convert.ToDouble(txt1.Text); txt2 = (TextBox)GridView1.Rows[i].FindControl("tboxRecNumb"); i2 = Convert.ToInt16(txt2.Text); } } }haidar_bilal
All-Star
45609 Points
8730 Posts
MVP
Re: possble mistaken empty statement
Jun 16, 2006 10:47 AM|LINK
Hello, can you see the huge format above? Do you have that ";" in your code? If yes, remove it please.
Regards
Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB
ohnobinki
Member
2 Points
1 Post
Re: possble mistaken empty statement
Dec 11, 2012 06:32 PM|LINK
The semicolon in the following line means that the whole if control block is terminated on that line:
What this means is that the above statement is pointless and does nothing. Perhaps you were expecting the line above to make execution of the following code block conditional on txt1.Text.Length being positive. However, with the code as you have written it, the following block gets executed unconditionally, always: