I want to Update An Number of goals That a Player Scored so if he socred a goal I want to do an update for his number of goals... I got an Error in my Code And I don\'t know how
If you're looking to default to 0 on an empty textbox:
int i = string.IsNullOrEmpty((SoccerTable.FooterRow.FindControl("txtAchNumsFooter") as TextBox).Text.Trim()) ? 0 : int.Parse((SoccerTable.FooterRow.FindControl("txtAchNumsFooter") as TextBox).Text.Trim());
If you're looking to default to 0 with any bad formatted input:
int i;
if (!int.TryParse((SoccerTable.FooterRow.FindControl("txtAchNumsFooter") as TextBox).Text.Trim(), out i)) i = 0;