Hi All,
i have an external list which is get data from simple SQL table. while viewing the External list work fine. but when i am trying to retrieve the data by CAML Problematically i am getting error 'Attempted to perform an unauthorized operation' .
using (SPSite oSite = new SPSite("Site Address"))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
SPList oList = oWeb.Lists.TryGetList("External_List_To_test_Linq");
SPQuery oQuery = new SPQuery();
string camlquery = @"<Where><Eq><FieldRef Name='ID'/><Value Type='Text'>1</Value></Eq></Where>";
oQuery.Query = camlquery;
SPListItemCollection listItemCollection = oList.GetItems(oQuery);
foreach (SPListItem oitem in listItemCollection)
{
Console.WriteLine("ID" + oitem);
}
}
}I am getting error while Reading the ID. it says 'Attempted to perform an unauthorized operation'.