System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
<pre> List<string> AppList = new List<string>();
public void loadApplicationDetail() { AppList.Clear(); var Selectlistapp = Dbl.ReturnDataset("select Address,Aort from tblor_Details"); if (Selectlistapp.Tables[0].Rows.Count > 0) { for (var i = 0; i < Selectlistapp.Tables[0].Rows.Count; i++) { string Address = Selectlistapp.Tables[0].Rows[i]["Address"].ToString(); string Aort = Selectlistapp.Tables[0].Rows[i]["Aort"].ToString(); AppList.Add("http://" + Address + ":" + Aort + "/"); } foreach (var app in AppList) //Error throws here in log file { bool sappvalue; ApplicationMonitorScript appmonitor = new ApplicationMonitorScript(); sappvalue = appmonitor.UrlIsValid(app); if (sappvalue == false) { MessageBox.Show("Stopped"); } else { MessageBox.Show("start"); } } } }
List<string> AppList = new List<string>()
foreach
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)