Can you try below code to get field name from item? It will iterate all fields of that item.
foreach (SPListItem listItem in list.Items)
{
foreach (SPField field in list.Fields)
{
object value = listItem[field.Id];
}
}
If it does not works for you then i would suggest use item.Url where you can split the URL to get list name.
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help
No comments:
Post a Comment