IIJIMASが勉強しようとしています。

これからこれから♪

目次

Blog 利用状況

ニュース

共著:




わんくま同盟 東京勉強会 #99 私の資料

個数を数えてみたい!

わんくま同盟 東京勉強会 #91 私の資料

きっと楽しいトポロジー

わんくま同盟 東京勉強会 #45 数学デー 私の資料(pptxとxlsx)

確率の不思議

わんくま同盟 東京勉強会 #37 私のLT資料

数の冪の和の式 を求めてみよう!

デブサミ09でわんくま同盟の紹介をしたスライド

わんくま同盟 東京勉強会 #26 LT祭りの私のスライド

わんくま同盟 東京勉強会 #23の私のスライド

わんくま同盟 東京勉強会 #18の私のスライド


自己紹介(仮)

IIJIMASと申します。
東京都多摩市在住です。多摩川のそばです。
猫好きです。
IIJIMASのSは何って言われます。 IIJIMASって
なんて読むかは自由です。
魚や網間企業とゲームとは無関係です。
数学とか宇宙とかの読み物とか好きです。
血液型:果汁100%A
メタボ予備軍。。。orz
Twitter

...............
MVP 審査応募ページ~ 求む、日本のMVP。
MCTS:.NET Framework 2.0: Windows アプリケーション
MCTS:.NET Framework 2.0: Windows アプリケーション

MCSD.NET:マイクロソフト認定ソリューションデベロッパー(MCSD) Microsoft .NET トラック
Microsoft Certified Solution Developer for Microsoft.NET

リンク

わんくま同盟
わんくま同盟

C#VB.NET掲示板
C#VB.NET掲示板

わんくま同盟 Blog's

ちょっと一言(仮)


書庫

日記カテゴリ

[SharePoint]リストにアイテムが約2100件以上あると・・・(続き:再現)

[SharePoint]リストにアイテムが約2100件以上あると・・・ の続きです。

「ドキュメント ライブラリ」の同じユーザが閲覧できるアイテムの数が1つのフォルダで約2100件超えている時にWeb画面で

<!-- #RENDER FAILED -->

と表示される件と、Microsoft.SharePoint名前空間のクラスを使用したプログラミングでの

System.Data.SqlClient.SqlException: 着信の表形式のデータ ストリーム (TDS) リモート プロシージャ コール (RPC) プロトコル ストリームが不適切です。この RPC 要求に指定されたパラメータが多すぎます。最大数は 2100 です。

という例外が起こる件についてです。kb958577(機械翻訳kb958577)

確実に再現できるC# コンソールアプリケーションのサンプルプログラムを作成してみました。MOSS2007 SP1(WSS3.0)のサーバーのローカルで実行します。

ファイルを大量にアップロードして、SPListItemCollection.Count プロパティを呼び出すだけです。

まずはSharePointサイトに新規にドキュメントライブラリを作成しておきます。
コンソールアプリケーションを作成して、参照設定でmicrosoft.sharepoint.dllを追加してcsファイル冒頭でusing Microsoft.SharePoint;を書いておきます。次のコードをプログラムの中に記述します。


/// <SUMMARY>
/// 同じファイルをコピーしてドキュメントライブラリに
/// </SUMMARY>
/// <PARAM name="docLib">ドキュメントライブラリ(SPDocumentLibraryオブジェクト)</PARAM>
/// <PARAM name="filePath">コピー元ファイルの絶対パス</PARAM>
/// <PARAM name="loginName">ドキュメント作成者、更新者とするユーザ</PARAM>
/// <PARAM name="start">連番開始番号</PARAM>
/// <PARAM name="end">連番終了番号</PARAM>
private static void UploadManyFiles(SPDocumentLibrary docLib, string filePath, string loginName, int start, int end) { SPWeb web = docLib.ParentWeb; SPFileCollection filecoll = web.Folders[docLib.Title].Files; string fileName = Path.GetFileNameWithoutExtension(filePath); string fileExt = Path.GetExtension(filePath); byte[] fileBytes = ReadAsBytes(filePath); SPUser user = web.EnsureUser(loginName); string url = ""; SPFile file = null; for (int i = start; i <= end; i++) { url = string.Format("{0}/{1}{2:D4}{3}", filecoll.Folder.Url, fileName, i, fileExt); Console.WriteLine("{0} is uploaded by {1}.", url, user.LoginName); file = filecoll.Add(url, fileBytes, user, user, DateTime.Now, DateTime.Now); file.Item.BreakRoleInheritance(false); file.Item.SystemUpdate(); } } /// <SUMMARY>
/// ファイルをバイト列として読み込む
/// </SUMMARY>
/// <PARAM name="filePath">パス</PARAM>
/// <RETURNS>ファイルの中身のバイト列</RETURNS>
private static byte[] ReadAsBytes(string filePath) { MemoryStream ms = new MemoryStream(); byte[] buffer = new byte[1024]; using (BinaryReader br = new BinaryReader(new FileStream(filePath, FileMode.Open))) { while (br.Read(buffer, 0, buffer.Length) > 0) { ms.Write(buffer, 0, buffer.Length); } } byte[] fileBytes = ms.ToArray(); return fileBytes; }

Main()の中で以下の変数の宣言や代入して(省略)下のコードを書きます。

  • docLib:そのSPDocumentLibraryオブジェクト。 SPListからasで取得するなど。
  • filePath:適当なファイルの絶対パス。
  • loginName:に投稿できる権限を持つユーザのログイン名。

・・・
//ドキュメント ライブラリのバージョン設定
//「このドキュメント ライブラリのファイルを編集するたびにバージョンを作成する 」で
//「   メジャーとマイナー (下書き) バージョンを作成する」を選択するのと同様。
docLib.EnableVersioning = true;
docLib.EnableMinorVersions = true;
//            docLib.DraftVersionVisibility = DraftVisibilityType.Reader;//(※1)
docLib.Update();

Console.WriteLine("EnableVersioning = {0}", docLib.EnableVersioning);
Console.WriteLine("EnableMinorVersions = {0}", docLib.EnableMinorVersions);
Console.WriteLine("DraftVersionVisibility = {0}", docLib.DraftVersionVisibility);
UploadManyFiles(docLib,filePath, loginName, 0, 2110);

//「この ドキュメント ライブラリ の下書きアイテムを表示できるユーザー」を 「アイテムを編集できるユーザー」にするのと同じ
docLib.DraftVersionVisibility = DraftVisibilityType.Author;//(※2)
docLib.Update();//(※2)
Console.WriteLine("DraftVersionVisibility = {0}", docLib.DraftVersionVisibility);
Console.WriteLine("list.Items.Count = {0}", docLib.Items.Count);//←ここで上記の例外が発生します!!!

ちなみに、(※1)の行をコメント解除して、(※2)の行をコメント化すると例外は発生しません。

Webでの設定画面でも「ドキュメント ライブラリ」>「バージョン設定」 >「下書きアイテムのセキュリティ」>「この ドキュメント ライブラリ の下書きアイテムを表示できるユーザー」 のラジオボタンの選択によって、以下のように起きない場合もあります。

アイテムを閲覧できるすべてのユーザー この例外が発生しない。
アイテムを編集できるユーザー この例外が発生する。
アイテムの作成者およびアイテムを承認できるユーザー
「コンテンツの承認を必須にする」が「はい」のとき
この例外が発生する。

投稿日時 : 2009年2月27日 0:59

コメントを追加

# [SharePoint]アイテム数が多数(約2100以上)あるリストのアイテムIDをすべて列挙しようとして・・・ 2009/03/18 11:30 IIJIMASが勉強しようとしています。

[SharePoint]アイテム数が多数(約2100以上)あるリストのアイテムIDをすべて列挙しようとして・・・

# [SharePoint]アイテム数が多数(約2100以上)あるリストのアイテムIDをすべて列挙しようとして・・・ 2009/03/18 11:32 IIJIMASが勉強しようとしています。

[SharePoint]アイテム数が多数(約2100以上)あるリストのアイテムIDをすべて列挙しようとして・・・

# kOMifnrjvsdfFC 2021/07/03 4:23 https://www.blogger.com/profile/060647091882378654

You could certainly see your expertise in the work you write. The world hopes for more passionate writers like you who aren at afraid to say how they believe. Always go after your heart.

# Illikebuisse yiarv 2021/07/04 9:05 pharmaceptica

sildenafil price https://pharmaceptica.com/

# For the reason that the admin of this web page is working, no uncertainty very soon it will be famous, due to its feature contents. 2021/08/31 22:13 For the reason that the admin of this web page is

For the reason that the admin of this web page is
working, no uncertainty very soon it will be famous,
due to its feature contents.

# Thanks a bunch for sharing this with all people you actually know what you are speaking about! Bookmarked. Kindly additionally discuss with my website =). We can have a hyperlink change contract among us 2021/09/02 9:49 Thanks a bunch for sharing this with all people yo

Thanks a bunch for sharing this with all people
you actually know what you are speaking about! Bookmarked.

Kindly additionally discuss with my website =).

We can have a hyperlink change contract among us

# Thanks a bunch for sharing this with all people you actually know what you are speaking about! Bookmarked. Kindly additionally discuss with my website =). We can have a hyperlink change contract among us 2021/09/02 9:50 Thanks a bunch for sharing this with all people yo

Thanks a bunch for sharing this with all people
you actually know what you are speaking about! Bookmarked.

Kindly additionally discuss with my website =).

We can have a hyperlink change contract among us

# Thanks a bunch for sharing this with all people you actually know what you are speaking about! Bookmarked. Kindly additionally discuss with my website =). We can have a hyperlink change contract among us 2021/09/02 9:51 Thanks a bunch for sharing this with all people yo

Thanks a bunch for sharing this with all people
you actually know what you are speaking about! Bookmarked.

Kindly additionally discuss with my website =).

We can have a hyperlink change contract among us

# Thanks a bunch for sharing this with all people you actually know what you are speaking about! Bookmarked. Kindly additionally discuss with my website =). We can have a hyperlink change contract among us 2021/09/02 9:52 Thanks a bunch for sharing this with all people yo

Thanks a bunch for sharing this with all people
you actually know what you are speaking about! Bookmarked.

Kindly additionally discuss with my website =).

We can have a hyperlink change contract among us

# Simply desire to say your article is as astounding. The clarity in your post is simply spectacular and i could assume you're an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks 2021/09/04 16:56 Simply desire to say your article is as astounding

Simply desire to say your article is as astounding.
The clarity in your post is simply spectacular and i could
assume you're an expert on this subject. Fine with your permission let me to grab your
RSS feed to keep updated with forthcoming post.

Thanks a million and please continue the rewarding work.

# Simply desire to say your article is as astounding. The clarity in your post is simply spectacular and i could assume you're an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks 2021/09/04 16:57 Simply desire to say your article is as astounding

Simply desire to say your article is as astounding.
The clarity in your post is simply spectacular and i could
assume you're an expert on this subject. Fine with your permission let me to grab your
RSS feed to keep updated with forthcoming post.

Thanks a million and please continue the rewarding work.

# Simply desire to say your article is as astounding. The clarity in your post is simply spectacular and i could assume you're an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks 2021/09/04 16:58 Simply desire to say your article is as astounding

Simply desire to say your article is as astounding.
The clarity in your post is simply spectacular and i could
assume you're an expert on this subject. Fine with your permission let me to grab your
RSS feed to keep updated with forthcoming post.

Thanks a million and please continue the rewarding work.

# Simply desire to say your article is as astounding. The clarity in your post is simply spectacular and i could assume you're an expert on this subject. Fine with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks 2021/09/04 16:59 Simply desire to say your article is as astounding

Simply desire to say your article is as astounding.
The clarity in your post is simply spectacular and i could
assume you're an expert on this subject. Fine with your permission let me to grab your
RSS feed to keep updated with forthcoming post.

Thanks a million and please continue the rewarding work.

# Unquestionably believe that which you said. Your favorite justification appeared to be at the web the simplest factor to take into accout of. I say to you, I certainly get irked at the same time as other folks think about worries that they plainly do 2021/09/05 8:18 Unquestionably believe that which you said. Your f

Unquestionably believe that which you said. Your favorite
justification appeared to be at the web the simplest factor to take into accout of.

I say to you, I certainly get irked at the same time as other
folks think about worries that they plainly do not recognise about.
You controlled to hit the nail upon the top and also defined out the whole thing
with no need side-effects , other people can take a signal.
Will likely be again to get more. Thanks

# Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20 2021/09/14 6:21 Wow that was strange. I just wrote an very long co

Wow that was strange. I just wrote an very long comment
but after I clicked submit my comment didn't show up.
Grrrr... well I'm not writing all that over again. Anyways, just
wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20bars quest
bars

# Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20 2021/09/14 6:22 Wow that was strange. I just wrote an very long co

Wow that was strange. I just wrote an very long comment
but after I clicked submit my comment didn't show up.
Grrrr... well I'm not writing all that over again. Anyways, just
wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20bars quest
bars

# Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20 2021/09/14 6:23 Wow that was strange. I just wrote an very long co

Wow that was strange. I just wrote an very long comment
but after I clicked submit my comment didn't show up.
Grrrr... well I'm not writing all that over again. Anyways, just
wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20bars quest
bars

# Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20 2021/09/14 6:24 Wow that was strange. I just wrote an very long co

Wow that was strange. I just wrote an very long comment
but after I clicked submit my comment didn't show up.
Grrrr... well I'm not writing all that over again. Anyways, just
wanted to say superb blog! quest bars https://www.iherb.com/search?kw=quest%20bars quest
bars

# May I simply just say what a relief to discover someone that truly knows what they are discussing online. You actually know how to bring an issue to light and make it important. More and more people have to look at this and understand this side of the st 2021/10/27 1:17 May I simply just say what a relief to discover so

May I simply just say what a relief to discover someone that truly knows what they are discussing online.
You actually know how to bring an issue to light and make it important.
More and more people have to look at this and understand this side
of the story. It's surprising you are not more popular since you surely possess the gift.

# doxycycline generic https://doxycyline1st.com/
doxycycline order online 2022/02/26 9:45 Jusidkid

doxycycline generic https://doxycyline1st.com/
doxycycline order online

# generic for clomid https://clomiden.fun/ 2022/04/12 13:00 Clomids

generic for clomid https://clomiden.fun/

# clomid https://clomidonline.icu/ 2022/07/08 13:41 Clomidj

clomid https://clomidonline.icu/

# ivermectin for cats mange https://stromectolbestprice.com/ 2022/07/30 0:35 BestPrice

ivermectin for cats mange https://stromectolbestprice.com/

# non prescription erection pills: https://medrxfast.com/ 2022/08/03 19:11 MedsRxFast

non prescription erection pills: https://medrxfast.com/

# male erection pills https://ed-pills.xyz/
ed meds 2022/09/15 19:16 EdPills

male erection pills https://ed-pills.xyz/
ed meds

# ed pills for sale https://ed-pills.xyz/
best medication for ed 2022/09/16 7:37 EdPills

ed pills for sale https://ed-pills.xyz/
best medication for ed

# medications for ed https://ed-pills.xyz/
ed medications online 2022/09/17 7:53 EdPills

medications for ed https://ed-pills.xyz/
ed medications online

# doxycycline tetracycline https://buydoxycycline.icu/ 2022/10/08 11:57 Doxycycline

doxycycline tetracycline https://buydoxycycline.icu/

#  https://clomidforsale.site/ 2022/11/13 14:27 ForSale

https://clomidforsale.site/

# prednisone 2.5 mg cost https://prednisonepills.site/
10 mg prednisone tablets 2022/11/30 0:57 Prednisone

prednisone 2.5 mg cost https://prednisonepills.site/
10 mg prednisone tablets

# farmacia senza ricetta recensioni https://viasenzaricetta.com/# 2023/04/16 13:03 ViaSenza

farmacia senza ricetta recensioni https://viasenzaricetta.com/#

# 400 mg prednisone - https://prednisonesale.pro/# 2023/04/22 4:56 Prednisone

400 mg prednisone - https://prednisonesale.pro/#

# buy cytotec pills online cheap - https://cytotecsale.pro/# 2023/04/29 4:33 Cytotec

buy cytotec pills online cheap - https://cytotecsale.pro/#

# best allergy medications over-the-counter https://overthecounter.pro/# 2023/05/08 22:37 OtcJikoliuj

best allergy medications over-the-counter https://overthecounter.pro/#

# canada pharmaceuticals online https://pillswithoutprescription.pro/# 2023/05/15 3:23 PillsPresc

canada pharmaceuticals online https://pillswithoutprescription.pro/#

# buy prednisone online uk https://prednisonepills.pro/# - prednisone price south africa 2023/06/04 21:35 Prednisone

buy prednisone online uk https://prednisonepills.pro/# - prednisone price south africa

# Paxlovid buy online https://paxlovid.pro/# - paxlovid buy 2023/07/02 17:35 Paxlovid

Paxlovid buy online https://paxlovid.pro/# - paxlovid buy

# paxlovid india https://paxlovid.store/
buy paxlovid online 2023/07/13 13:27 Paxlovid

paxlovid india https://paxlovid.store/
buy paxlovid online

# paxlovid india https://paxlovid.life/# buy paxlovid online 2023/07/25 20:46 Paxlovid

paxlovid india https://paxlovid.life/# buy paxlovid online

# buy cytotec online fast delivery https://cytotec.ink/# - cytotec online 2023/07/26 14:45 PillsFree

buy cytotec online fast delivery https://cytotec.ink/# - cytotec online

# farmacia online miglior prezzo https://farmaciait.pro/ farmacia online più conveniente 2023/12/04 10:08 Farmacia

farmacia online miglior prezzo https://farmaciait.pro/ farmacia online più conveniente

# eva elfie filmleri https://evaelfie.pro/ eva elfie video 2024/03/03 10:26 EvaElfia

eva elfie filmleri https://evaelfie.pro/ eva elfie video

# abella danger filmleri https://abelladanger.online/ abella danger filmleri
2024/03/06 10:58 Adella

abella danger filmleri https://abelladanger.online/ abella danger filmleri

# eva elfie new videos https://evaelfie.site/ eva elfie full video
2024/03/07 2:10 EvaElfie

eva elfie new videos https://evaelfie.site/ eva elfie full video

# gates of olympus hilesi - https://gatesofolympus.auction/ pragmatic play gates of olympus 2024/03/27 20:42 Olympic

gates of olympus hilesi - https://gatesofolympus.auction/ pragmatic play gates of olympus

# prednisone daily use 2024/08/06 17:37 Stevenput

where can i buy prednisone without prescription https://prednisonebestprice.pro/# prednisone prescription for sale
prednisone pills for sale

# furosemide 100 mg 2024/08/19 16:57 DanielEruts

buy cytotec online fast delivery http://cytotec.pro/# buy cytotec
lasix side effects

# furosemida 40 mg 2024/08/20 3:15 DanielEruts

Misoprostol 200 mg buy online https://tamoxifen.bid/# tamoxifen vs raloxifene
furosemide 40 mg

# lasix 100mg 2024/08/22 7:03 DanielEruts

cytotec abortion pill https://tamoxifen.bid/# tamoxifen rash
lasix furosemide

# lasix 20 mg 2024/08/23 10:44 DanielEruts

purchase cytotec https://cytotec.pro/# cytotec pills buy online
lasix 40mg

# pharmacies in mexico that ship to usa 2024/08/25 23:48 Jeremymet

http://mexstarpharma.com/# mexican border pharmacies shipping to usa

# vavada 2024/09/05 10:10 Warrenpseut

https://pin-up.diy/# пин ап казино

# вавада казино 2024/09/06 1:28 Warrenpseut

https://pin-up.diy/# пинап казино

# вавада зеркало 2024/09/07 6:39 Warrenpseut

http://vavada.auction/# вавада зеркало

# gate of olympus oyna 2024/09/18 22:52 GeorgeMum

https://gatesofolympusoyna.online/# gates of olympus giris

# gates of olympus demo turkce 2024/09/19 14:34 GeorgeMum

https://casibom.auction/# casibom 158 giris

# Gates of Olympus 2024/09/20 22:50 GeorgeMum

http://gatesofolympusoyna.online/# gates of olympus oyna

# farmacia online madrid 2024/09/21 14:59 FloydUnorm

https://farmaciaeu.com/# farmacia online madrid
п»?farmacia online espaГ±a

# п»їfarmacia online espaГ±a 2024/09/22 6:22 FloydUnorm

https://tadalafilo.bid/# farmacias online seguras
farmacia barata

# se puede comprar sildenafil sin receta 2024/09/23 1:28 DennisevElp

https://farmaciaeu.com/# farmacia barata

# farmacia online piГ№ conveniente 2024/09/24 18:26 Charlesnub

http://tadalafilit.com/# top farmacia online
Farmacia online piГ№ conveniente

# ventolin tablets buy 2024/09/28 12:14 Sergiodab

https://ventolininhaler.pro/# buying ventolin in usa

# ventolin online usa 2024/09/29 22:54 Sergiodab

https://prednisolone.pro/# cheap prednisone 20 mg

# pharmacie en ligne livraison europe 2024/10/04 0:09 StephenWadly

http://pharmaciepascher.pro/# pharmacie en ligne france livraison internationale

# Pharmacie sans ordonnance 2024/10/05 20:39 StephenWadly

http://pharmaciepascher.pro/# pharmacie en ligne livraison europe

タイトル
名前
URL
コメント