If you facing this error...
if you save or read a column using splistitem["Created By"] or splistitem[internalname]...
You get this error...
Exception Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler(). Exception information: Exception information: System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.SPFieldMap.GetColumnNumber(String strFieldName, Boolean bThrow) at Microsoft.SharePoint.SPListItemCollection.GetColumnNumber(String groupName, Boolean bThrowException) at Microsoft.SharePoint.SPListItemCollection.GetRawValue(String fieldname, Int32 iIndex, Boolean bThrow) at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw, Boolean bThrowException) at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowException) at Microsoft.SharePoint.SPListItem.get_Item(String fieldNa...
Your list has a too much columns (Lookup, Person/Group, or workflow status fields)
You need to increase your "List View Lookup Threshold"

Go to Application Management --> Manage Web Applications --> select your application --> General Setting --> Resource Throttling --> List View Lookup Threshold --> Put a number more than number of your list columns. maybe 30, 40, or 50.
and Save it.
Now It should be working!
Enjoy DDIBA~! 
To hide "My Site" on top navigation.

.ms-globalnavicon{
display: none;
}
Put that code in your master page "MySite.master"
in <Header>
</Header>
-----------------------------------------------------------------------------------------------------
To hide "My Newsfeed, My Content" global navigation menu.
.ms-globalnavmenu{
display: none;
}
Put that code in your master page "MySite.master"
in <Header>
</Header>
-----------------------------------------------------------------------------------------------------
To hide "Find People" Searchbox global navigation menu.

.ms-ms-globalnavsearch{
display: none;
}
Put that code in your master page "MySite.master"
in <Header>
</Header>
Use this,
catch (Exception ex)
{
Log("your fuction,method,application name", Microsoft.SharePoint.Administration.TraceSeverity.High, Microsoft.SharePoint.Administration.EventSeverity.Error, ex.Message);
}
--------------------------------------------------------------------------------------
void Log(string source, TraceSeverity traceSeverity, EventSeverity eventSeverity, string logMessage)
{
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(source, traceSeverity, eventSeverity), traceSeverity, logMessage, null);
}
Now, check your log file on 14 hive, if you have any error,
SharePoint 2010, Programmatically get multichoicevalues from list item
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Microsoft.SharePoint;
namespace MultiChoice
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://serverName/"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists.TryGetList("yourListName");
if (list != null)
{
SPListItem item = list.Items[0];
SPFieldMultiChoiceValue choices = new SPFieldMultiChoiceValue(item["MultiChoice"].ToString());
for (int i = 0; i < choices.Count; i++)
{
Console.WriteLine(choices[i]);
}
Console.ReadLine();
}
}
}
}
}
}
Enjoy DDIBA~! 
Try this.
public static string GetUserAccountFromList(SPListItem item)
{
SPFieldUserValue fieldValue = null;
SPUser user = null;
SPFieldUser UserColumn = (SPFieldUser)item.Fields.GetField("YourUserFieldName");
fieldValue = UserColumn.GetFieldValue(item[fieldName].ToString()) as SPFieldUserValue;
if (fieldValue != null)
user = fieldValue.User;
return user;
}
Enjoy DDIBA~!

If you have a custom development (webpart, gridview, and etc...) on SharePoint and update/add more than 1000 items on you list... i might get some wired error like:
Operation is not valid due to the current state of the object
By default MaxHttpCollectionKeys is set to 1,000.
So, you need to increase this value in Web.Config
*****************************************************************
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="10000" />
</appSettings>
*****************************************************************
Server Error in '/' Application.
Operation is not valid due to the current state of the object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[InvalidOperationException: Operation is not valid due to the current state of the object.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +4148319
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +60
System.Web.HttpRequest.FillInFormCollection() +189
[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +11111400
System.Web.HttpRequest.get_Form() +119
Microsoft.SharePoint.SPGlobal.GetParametersFromHttpRequest(SPSite site, Boolean bAuthenticated) +422
Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) +27616569
Microsoft.SharePoint.SPWeb.InitializeSPRequest() +223
Microsoft.SharePoint.WebControls.SPControl.EnsureSPWebRequest(SPWeb web) +365
Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context) +520
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.GetContextWeb(HttpContext context) +27
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostResolveRequestCacheHandler(Object oSender, EventArgs ea) +918
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
|
Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5456
ENJOY DDIBA~! 
How to Retrieve Text from Enhanced Rich Text Column Programmatically.
Use this code...
SPFieldMultiLineText spFieldMultiLineText = spListItem.Fields["EnhancedRichTextColumn"] as SPFieldMultiLineText;
string text = spFieldMultiLineText.GetFieldValueAsText(spListItem["EnhancedRichTextColumn"]);
Enjoy DDIBA~! 
Try this code...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;
namespace YourProject
{
public class LoggingService : SPDiagnosticsServiceBase
{
public static string DiagnosticAreaName = "Your Diag Area Name";
protected override IEnumerable<SPDiagnosticsArea> ProvideAreas()
{
List<SPDiagnosticsArea> areas = new List<SPDiagnosticsArea>
{
new SPDiagnosticsArea(DiagnosticAreaName, new List<SPDiagnosticsCategory> { new SPDiagnosticsCategory(DiagnosticAreaName, TraceSeverity.Unexpected, EventSeverity.Error) })
};
return areas;
}
public static void Log(string source, TraceSeverity traceSeverity, EventSeverity eventSeverity, string logMessage)
{
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(source, traceSeverity, eventSeverity), traceSeverity, logMessage, null);
}
}
}
And use this in your code like this...
private void YourMethodOrFunction()
{
try
{
Do... Run...
}
catch (Exception ex)
{
LoggingService.Log("Your Application Name", Microsoft.SharePoint.Administration.TraceSeverity.High, Microsoft.SharePoint.Administration.EventSeverity.Error, ex.Message);
}
}
And check your Log file in Logs folder.
Location: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
Enjoy~! DDIBA~! 
Clear, Remove, Delete SharePoint 2010 people editor Value Post Back Event PeopleEditor picker = PeopleSelector; picker.Accounts.Clear(); picker.Entities.Clear(); picker.ResolvedEntities.Clear(); --------------------------------------------------------------------------------------------- This code will trigger every time the page refreshes; this means, if you need to trigger it on button click, ensure you call a clearPicker function from below on OnClientClick event of your button or means similar to this.
<script type="text/javascript">
// this registers clearPicker to run every time the page reloads
_spBodyOnLoadFunctionNames.push("clearPicker");
// this is the function that clears the picker and helper variables
function clearPicker() {
var control;
var arr = document.getElementsByTagName("div");
for (var i = 0; i < arr.length; i++) {
if (arr[i].id.indexOf("upLevelDiv") > 0)
{ control = arr[i]; }
}
control.innerHTML = '';
arr = document.getElementsByTagName("input");
for (var i = 0; i < arr.length; i++) {
if (arr[i].name.indexOf("hiddenSpanData") > 0)
{ control = arr[i]; }
}
control.value = '';
}
</script>
That’s it; the upLevelDiv and hiddenSpanData now contains no resolved values and the people editor appears cleared.
public static SPUser GetSPUser(SPListItem item, string key)
{
SPFieldUser field = item.Fields[key] as SPFieldUser;
SPFieldUserValue fieldValue =
field.GetFieldValue(item[key].ToString()) as SPFieldUserValue;
if (fieldValue != null)
return fieldValue.User;
}
Enjoy DDIBA~! 