Skip to content

Instantly share code, notes, and snippets.

@kawakawa
Created February 19, 2013 09:44
Show Gist options
  • Save kawakawa/4984461 to your computer and use it in GitHub Desktop.
Save kawakawa/4984461 to your computer and use it in GitHub Desktop.
SharePointで「値が有効な範囲にありません。」エラーが発生した時のソースサンプル
using (SPSite site = new SPSite(context.SiteUrl))
using (var web = site.OpenWeb(context.WebUrl))
{
var list = web.Lists[context.ListId];
var item = list.Items.GetItemById(itemId);
var value = item["フィールド名"]; //ここで例外が発生
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment