Update a List in the morning !!!
-
2011년 1월 14일 금요일 오후 11:38HI All, I have a requirement in which the custom list has to get updated everyday morning by deleting all the list items and adding new items. Can anyone tell me how to achieve this ?? Thank you.
모든 응답
-
2011년 1월 15일 토요일 오전 12:27
Hi scvinod,
You have to create a timerjob to achive this. That TimerJob should scheduled to run everyday morning which handles the deletion and addition of items to that List.
Creating Custom Timerjob using http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx
Shantha Kumar T - MCPD
(B) http://www.ktskumar.com
(T) http://twitter.com/ktskumar
IOTAP
Shantha Kumar .T MCPD - SharePoint Developer 2010- 답변으로 제안됨 Ahmed Naji 2011년 1월 15일 토요일 오전 5:51
- 답변으로 표시됨 GuYumingMicrosoft Contingent Staff, Moderator 2011년 1월 21일 금요일 오전 6:16
-
2011년 1월 15일 토요일 오전 5:50
check also how to create custom timer job in SharePoint 2010 in the following link
Creating Custom Timer Job in SharePoint 2010
Regards.
Ahmed Naji SharePoint Geek
MCP|MCTS
My Blog | DotnetFinder- 답변으로 제안됨 Ahmed Naji 2011년 1월 15일 토요일 오전 5:51
- 답변으로 표시됨 GuYumingMicrosoft Contingent Staff, Moderator 2011년 1월 21일 금요일 오전 6:17
-
2011년 1월 15일 토요일 오후 5:10
HI,
Thanks for the reply...wen i delete or add the items in the list through timer jobs I'm getting this error " Collection was modified; enumeration operation may not execute ". Can I know any solution for this. Thank you.
-
2011년 1월 15일 토요일 오후 5:39
Hi scvinod
Deleting List Items in a SharePoint List
if it's not solve the problem you can Ask a question in SharePoint 2010 - Using Visual Studio with SharePoint and other programming
and show us your code .
Regards.
Ahmed Naji SharePoint Geek
MCP|MCTS
My Blog | DotnetFinder- 답변으로 표시됨 GuYumingMicrosoft Contingent Staff, Moderator 2011년 1월 21일 금요일 오전 6:17
-
2011년 1월 16일 일요일 오전 3:17
It's because of you are deleting the listitems from first item to last item. If we do like that, after deletion of single items, that will update the index value of list item collection. Because of that we are getting the error.
Instead we have to enumerate the list collection from last item to first item and the delete them. For deleting the list items, try the following snippet,
SPWeb mySite = SPContext.Current.Web;
SPListItemCollection listItems = mySite.Lists.TryGetList([ListName]).Items;
int itemCount = listItems.Count;for (int k=itemCount - 1; k >= 0; k--)
{
listItems.Delete(k);
}Shantha Kumar T - MCPD
(B) http://www.ktskumar.com
(T) http://twitter.com/ktskumar
IOTAP
Shantha Kumar .T MCPD - SharePoint Developer 2010
- 답변으로 표시됨 SC Vinod 2011년 2월 28일 월요일 오전 6:36

