문제

사용자가 텍스트 상자에 데이터를 입력하고 제출을 클릭하고 URL이 텍스트 상자 에이 데이터가 포함되어있는 모든 사이트 모음을 가져 오는 모든 사이트 모음을 가져 오는 Linq 쿼리를 사용하여 모든 사이트를URL 이이 텍스트 상자 값이 포함 된 현재 웹 응용 프로그램이지만, 이것이 가장 좋은 방법인지 확실하지 않고,이 방법이 모든 Swinaite Disposedal을 잘 처리하는지 확실하지는 않습니다.이러한 물체의어떤 도움이 필요합니까?

도움이 되었습니까?

해결책

You will need to dispose the SPSite objects and write an extension method for that since it is in LINQ. However, you can also achieve your result using foreach loops instead of LINQ.

See this for more information on using LINQ and SharePoint objects which need to be disposed like SPSite and SPWeb:

https://stackoverflow.com/questions/657095/using-linq-with-sharepoint-and-disposing-of-objects http://solutionizing.net/2009/01/05/linq-for-spwebcollection-revisited-assafeenumerable/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top