you can use Fields.ContainsField to check if the List Column exists from the custom List, So that, you can avoid error for running Custom Code Webpart.
if(reqReadlist.Fields.ContainsField("RequestID"))
{
LogMessage("RequestID " + Reqitem["RequestID"], EventLogEntryType.Error);
dr["Requisition No"] = Convert.ToString(Reqitem["RequestID"]);
}
else
{
LogMessage("Not Available RequestID ", EventLogEntryType.Error);
}
No comments:
Post a Comment