I used grid view to display SharePoint 2010 list data. To have data filtered (used Sp-query for that), I used 'Author' field in C# which is similar to 'Created By' in SharePoint list. It's working fine in the local development. But when deploy the code in test environment, it was throwing error:
Field not found: Author
Sp Query is queryRR.Query = "<Where><And><Eq><FieldRef Name='Author' /><Value Type='User'>" + userName + "</Value></Eq><Eq><FieldRef Name='Publish' /><Value Type='Boolean'>0</Value></Eq></And></Where>"
Then I changed the code and put all the list data in grid (without any condition). Again deployed the code in test and checked it, I found both columns were missing - Author (Created By) and Editor (Modified By). It was strange. I checked many blogs but no use.
Is there any configuration problem on the test server or something missing in the code?