The system some time give the error mentioned in the title. the code block is given below. when i debug or try to check it it does not give an error but when the system is running it gives error. i use this code in remoting application which runs 24 hour. some one to answer please.
try
{
foreach (DataRow row in table.Rows)
{
Item item = new Item();
if (row["ID"] != null)
{
item.ID = long.Parse(row["SetID"].ToString());
IProtocols p = Cache.ALL.Find(item.ID,UniqueID);
foreach (Item protocol in p)
{
item.ID = protocol.AgencyID;
item.Actions = protocol.Actions;
item.CreatedByID = protocol.CreatedByID;
item.CreatedDate = protocol.CreatedDate;
item.Deleted = protocol.Deleted;
item.OId = protocol.OId;
item.Name = protocol.Name;
item.ID = protocol.ID;
}
}
item.ID = long.Parse(row["SetID"].ToString());
if (row["ID"] != DBNull.Value)
{
item.OID = long.Parse(row["OID"].ToString());
}
if (row["CreatedByID"] != DBNull.Value)
{
item.AssignedByID = long.Parse(row["CreatedByID"].ToString());
}
Cache.ALL.Add(item);
}
}
catch (Exception ex)
{
throw new Exception("Error: " + ex.Message);
}