Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

FieldUserValue object giving this error "Unable to cast object of type 'Microsoft.SharePoint.Client.FieldUserValue[]' to type 'Microsoft.SharePoint.Client.FieldUserValue'."

$
0
0

Hi,

I am getting the below error while retrieving the list column value

"Unable to cast object of type 'Microsoft.SharePoint.Client.FieldUserValue[]' to type 'Microsoft.SharePoint.Client.FieldUserValue'."

Here is the code i have written                                       

foreach (Microsoft.SharePoint.Client.ListItem oListItem in listItemV)
            {
                if (oListItem["Product_x0020_Name_x0020_Admin"] != null)
                {                    

                    FieldUserValue fl = (FieldUserValue)oListItem["Product_x0020_Name_x0020_Admin"];

                    if (strTo == String.Empty && strTo != null)
                        strTo += fl.LookupValue.ToString();
                        //strTo += fl;
                    else
                        //strTo += "," + fl;
                    strTo += "," + fl.LookupValue.ToString();
                    //strTo += ";" + fl.LookupValue.ToString();
                }
            }

In the list, list column has 4 values.

Please help me for the same.

Thanks

Rehman


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>