<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1874849975900232494</id><updated>2011-07-07T18:44:45.842-07:00</updated><category term='Shared Service Provider'/><category term='Custom Paging'/><category term='field type'/><category term='exchange server 2007'/><category term='SQL Server'/><category term='mailbox'/><category term='SharePoint'/><category term='Paging'/><category term='MOSS'/><category term='create mailbox'/><category term='programmatically'/><category term='template'/><category term='sharepoint 2007'/><category term='Large Table'/><title type='text'>Mohamed Khaled ABRASS</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-506448369267741951</id><published>2010-06-11T00:31:00.000-07:00</published><updated>2010-06-11T00:44:14.868-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shared Service Provider'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Shared Service Provider Creation Provisioning Failed</title><content type='html'>When you create Shared Service Provider, you can get the following error: Shared  Service Provider Provisioning Failed: user can't be found. Shortly when you create SSP, the job will create a site collection for administration site of SSP and the job make the users who are site collection administrators of central administration as site collection administrators for the site collection of SSP. but when the site collection administrators of central administration are wrong, the job will failed. So to fix it, just do the following:&lt;div&gt;1. Go to central administration site collection and set the site collection administrators correctly.&lt;/div&gt;&lt;div&gt;2. Execute the following command: stsadm -o execadmsvcjobs . &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-506448369267741951?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/506448369267741951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=506448369267741951' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/506448369267741951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/506448369267741951'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2010/06/shared-service-provider-creation.html' title='Shared Service Provider Creation Provisioning Failed'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-2337513544402081358</id><published>2010-02-28T09:32:00.001-08:00</published><updated>2010-02-28T09:32:29.292-08:00</updated><title type='text'>Login failed for user 'Domain\UserName'. [CLIENT: IP address] with SharePoint Farm | Deleting SSP Shared Service Provider</title><content type='html'>&lt;p class="MsoNormal"&gt;Of course when you get this error in SQL server, you thought that there is a process which is trying to connect with SQL Server with wrong user name or password. But with SharePoint Environment and when you delete SSP and its associated database, you will get this error and the reason is: &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;when you delete SSP, SharePoint does not delete the JOB which is responsible for deleting expired sessions so this job is working each minutes and try to connect to SSP database, therefore you should delete this job manually after deleting SSP.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-2337513544402081358?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/2337513544402081358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=2337513544402081358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/2337513544402081358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/2337513544402081358'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2010/02/login-failed-for-user-domainusername.html' title='Login failed for user &apos;Domain\UserName&apos;. [CLIENT: IP address] with SharePoint Farm | Deleting SSP Shared Service Provider'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-7160343249433587942</id><published>2010-02-23T09:12:00.000-08:00</published><updated>2010-02-23T09:16:19.022-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Large Table'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to delete or truncate large table</title><content type='html'>&lt;p class="MsoNormal"&gt;In this post I’ll explain how to empty large table. One of our customers had a table with 450GB of size. And we tried all ways to empty this table, but no one has solved the problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We tried to truncate the table, but truncate operation took more than 10 hours and didn’t solve the problem. And when we used WHERE statement in any query on this table, SQL server executes the query without stopping.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The only way that I could to empty the table in 1 second was as the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;set&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:blue"&gt;rowcount&lt;/span&gt; 1&lt;span style="color:gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;truncate&lt;/span&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof: yes"&gt; &lt;span style="color:blue"&gt;table&lt;/span&gt; TABLE_NAME&lt;span style="color:gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And of course after truncating the table, just go and shrink the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-7160343249433587942?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/7160343249433587942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=7160343249433587942' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/7160343249433587942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/7160343249433587942'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2010/02/how-to-delete-or-truncate-large-table.html' title='How to delete or truncate large table'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-7593934246955410039</id><published>2009-10-09T08:24:00.000-07:00</published><updated>2009-10-09T08:27:46.172-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom Paging'/><category scheme='http://www.blogger.com/atom/ns#' term='Paging'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>Custom Paging in SharePoint List</title><content type='html'>&lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;To do custom paging in SharePoint list, just we should calculate the position of last item (&lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;ListItemCollectionPosition) and pass it to the query.&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt; The steps to do paging are as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed"&gt;&lt;span style="font-family:&amp;quot;Courier New&amp;quot;;mso-fareast-Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;span style="mso-list:Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span dir="LTR"&gt;&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;Get the previous page last &lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;; mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:#2B91AF;"&gt;SPList&lt;/span&gt;&lt;span style=" line-height:115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; &lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;Item. And then generate the paging filter string as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:#2B91AF;"&gt;SPList&lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; assetList = web.Lists[listName];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;text-indent:36.0pt;line-height:normal;mso-layout-grid-align: none;text-autospace:none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style="Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;color:#2B91AF;"&gt;SPQuery&lt;/span&gt;&lt;span style="Courier New&amp;quot;; mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; query = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPQuery&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;query.Query = camel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;query.RowLimit = (&lt;span style="color:blue;"&gt;uint&lt;/span&gt;)(pageItemCount * (pageIndex - 1));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;assetDetailsItems = assetList.GetItems(query);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:blue;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:blue;"&gt;int&lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; previousPageLastItemPosition = assetDetailsItems.Count - 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;text-indent:36.0pt;line-height:normal;mso-layout-grid-align: none;text-autospace:none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style="Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;color:#2B91AF;"&gt;StringBuilder&lt;/span&gt;&lt;span style="Courier New&amp;quot;; mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; columnBuilder = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;StringBuilder&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (columnNames != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;string&lt;/span&gt; column &lt;span style="color:blue;"&gt;in&lt;/span&gt; columnNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; columnValue = (assetDetailsItems[previousPageLastItemPosition][column] == &lt;span style="color:blue;"&gt;null&lt;/span&gt;) ? &lt;span style="color:blue;"&gt;string&lt;/span&gt;.Empty : assetDetailsItems[previousPageLastItemPosition][column].ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;columnBuilder.Append(&lt;span style="color:#A31515;"&gt;"&amp;amp;p_"&lt;/span&gt; + column + &lt;span style="color:#A31515;"&gt;"="&lt;/span&gt; + columnValue);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;      &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed"&gt;&lt;span style="font-family:&amp;quot;Courier New&amp;quot;;mso-fareast-Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span dir="LTR"&gt;&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;Create &lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;;mso-no-proof: yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;SPListItemCollectionPosition object based on columns details which retieved in step 1.&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;mso-add-space: auto;text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:#2B91AF;"&gt;SPListItemCollectionPosition&lt;/span&gt;&lt;span style="Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; objSPListColPos = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPListItemCollectionPosition&lt;/span&gt;(&lt;span style="color:#A31515;"&gt;"Paged=TRUE"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;mso-add-space: auto;text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;+ columnBuilder.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;query.ListItemCollectionPosition = objSPListColPos;&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" dir="LTR" style="margin-top:0cm;margin-right: 0cm;margin-bottom:10.0pt;margin-left:36.0pt;mso-add-space:auto;text-align:left; text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed"&gt;&lt;span style="font-family:&amp;quot;Courier New&amp;quot;;mso-fareast-Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span dir="LTR"&gt;&lt;/span&gt;&lt;span style="line-height:115%;Courier New&amp;quot;; mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;Pass the SPQuery to the GetItems function, which will fetch items starting from the position that we created in step 2.&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-left:36.0pt;text-align:left; direction:ltr;unicode-bidi:embed"&gt;&lt;span style="line-height: 115%;Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;assetList.GetItems(query);&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;The following function does the paging for you, and in each calling, it will calculate first the total items count and then generate the last position for the page index parameter and finally get the items by using GetItems Function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;color:blue;"&gt;public&lt;/span&gt;&lt;span style="Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;DataTable&lt;/span&gt; GetItems(&lt;span style="color:blue;"&gt;string&lt;/span&gt; webSite, &lt;span style="color:blue;"&gt;string&lt;/span&gt; listName, &lt;span style="color:blue;"&gt;string&lt;/span&gt; camel,&lt;span style="color:blue;"&gt;string&lt;/span&gt; viewFields, &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] columnNames, &lt;span style="color:blue;"&gt;int&lt;/span&gt; pageIndex, &lt;span style="color:blue;"&gt;int&lt;/span&gt; pageItemCount,&lt;span style="color:blue;"&gt;out&lt;/span&gt; &lt;span style="color:blue;"&gt;int&lt;/span&gt; ItemsCount)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;SPListItemCollection&lt;/span&gt; assetDetailsItems = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2B91AF;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPSite&lt;/span&gt;(webSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:#2B91AF;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// Get the list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;SPList&lt;/span&gt; assetList = web.Lists[listName];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;SPQuery&lt;/span&gt; query = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPQuery&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query.Query = camel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (!&lt;span style="color:blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(viewFields))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewAttributes = &lt;span style="color:#A31515;"&gt;"Scope='RecursiveAll'"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewFields = viewFields;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// first calculate the totla items count&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;assetDetailsItems = assetList.GetItems(query);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;ItemsCount = assetDetailsItems.Count;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// Retrieve the items for the last page. E.g.: If request is for 5th page and item count/page=10 then row limit will retrieve 40 items and 40th item will be used to get the column details which will be used for pagination. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPQuery&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query.Query = camel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (!&lt;span style="color:blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(viewFields))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewAttributes = &lt;span style="color:#A31515;"&gt;"Scope='RecursiveAll'"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewFields = viewFields;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query.RowLimit = (&lt;span style="color:blue;"&gt;uint&lt;/span&gt;)(pageItemCount * (pageIndex - 1));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;   &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;                 &lt;/span&gt;assetDetailsItems = assetList.GetItems(query);&lt;span style="mso-spacerun:yes"&gt;                 &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// Get the previous page last item position. Use this item to retrieve the column details which will be used for pagination.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt; previousPageLastItemPosition = assetDetailsItems.Count - 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// generate the last position&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;StringBuilder&lt;/span&gt; columnBuilder = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;StringBuilder&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (columnNames != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;     &lt;/span&gt;&lt;span style="mso-spacerun:yes"&gt;               &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;string&lt;/span&gt; column &lt;span style="color:blue;"&gt;in&lt;/span&gt; columnNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                            &lt;/span&gt;&lt;span style="color:green;"&gt;// Make sure that if the field value is mandatory and if you are passing it as NULL then SPList.GetItems will throw exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                            &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; columnValue = (assetDetailsItems[previousPageLastItemPosition][column] == &lt;span style="color:blue;"&gt;null&lt;/span&gt;) ? &lt;span style="color:blue;"&gt;string&lt;/span&gt;.Empty : assetDetailsItems[previousPageLastItemPosition][column].ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                            &lt;/span&gt;&lt;span style="color:green;"&gt;// Check if the value is null or empty&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                            &lt;/span&gt;columnBuilder.Append(&lt;span style="color:#A31515;"&gt;"&amp;amp;p_"&lt;/span&gt; + column + &lt;span style="color:#A31515;"&gt;"="&lt;/span&gt; + columnValue);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPQuery&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query.Query = camel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (!&lt;span style="color:blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(viewFields))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewAttributes = &lt;span style="color:#A31515;"&gt;"Scope='RecursiveAll'"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ViewFields = viewFields;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// Create Paging Information which will be used for retrieving paging based items&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;SPListItemCollectionPosition&lt;/span&gt; objSPListColPos = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2B91AF;"&gt;SPListItemCollectionPosition&lt;/span&gt;(&lt;span style="color:#A31515;"&gt;"Paged=TRUE"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;+ columnBuilder.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;query.RowLimit = &lt;span style="color:blue;"&gt;uint&lt;/span&gt;.Parse(pageItemCount.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// check if the page index = 1,that mean no need for list position&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (pageIndex != 1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                        &lt;/span&gt;query.ListItemCollectionPosition = objSPListColPos;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;&lt;span style="color:green;"&gt;// Execute the CAML query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                    &lt;/span&gt;assetDetailsItems = assetList.GetItems(query);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="margin-bottom:0cm;margin-bottom:.0001pt; text-align:left;line-height:normal;mso-layout-grid-align:none;text-autospace: none;direction:ltr;unicode-bidi:embed"&gt;&lt;span style=" Courier New&amp;quot;;mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; assetDetailsItems.GetDataTable();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="line-height:115%;Courier New&amp;quot;; mso-no-proof:yesfont-family:&amp;quot;;font-size:10.0pt;"&gt;&lt;span style="mso-spacerun:yes"&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;[Note: we can increase the performance of the code by storing the last calculated position in view state and don't generate it each time, but in this case we can do paging not by numbers but with next and previous functionality]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" dir="LTR" style="text-align:left;direction:ltr;unicode-bidi: embed"&gt;&lt;span style="Courier New&amp;quot;font-family:&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-7593934246955410039?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/7593934246955410039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=7593934246955410039' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/7593934246955410039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/7593934246955410039'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2009/10/custom-paging-in-sharepoint-list.html' title='Custom Paging in SharePoint List'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-4962677672256482026</id><published>2009-06-22T10:15:00.000-07:00</published><updated>2010-01-30T09:18:55.144-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='create mailbox'/><category scheme='http://www.blogger.com/atom/ns#' term='programmatically'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange server 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='mailbox'/><title type='text'>How to create Mailbox in Exchange Server 2007 programmatically</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:courier new;"&gt;If you have exchange server 2007 or you want to upgrade from exchange server 2003 to exchange server 2007. And you want your end user to create his email on exchange from your application or portal. Of course in exchange 2003 we can use CDOEXM to create mailboxes programmatically. But in exchange server 2007 doesn't support CDOEXM. Therefore to do this, we should depend on Power Shell in creating mailboxes. &lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;The prerequisites are just to install power shell on your web server and of course you need to install the Exchange Server Management Tools on the server that will execute the code.&lt;br /&gt;After that you can use this function: &lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;br /&gt;public static IList CreateEmail(string userName, string mail, string domain, string ou, string exDatabase)&lt;br /&gt;{&lt;br /&gt;//create the command&lt;br /&gt;string cmd = string.Format("Enable-Mailbox -Identity '{0}/{1}/{2}' -Alias '{3}' -Database '{4}'", domain, ou, userName, mail, exDatabase);&lt;br /&gt;ExchangeManagementShellWrapper ems = ExchangeManagementShellWrapper.Instance;&lt;br /&gt;ICollection&lt;psobject&gt; results;&lt;br /&gt;IList IErrors;&lt;br /&gt;&lt;br /&gt;results = ems.RunspaceInvoke(cmd, out IErrors);&lt;br /&gt;&lt;br /&gt;return IErrors;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="font-family:courier new;"&gt;Of course this function needs user name, mail (the name that you want to be user email), domain, ou (which represents the organization unit path, which this user is existed on), and exchange database. And by using ExchangeManagementShellWrapper you can run this command and get the result.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;for source code of ExchangeManagmentShellWrapper, you can download it from internet or anyone who need it,I can send it to him by email.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-4962677672256482026?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/4962677672256482026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=4962677672256482026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/4962677672256482026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/4962677672256482026'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2009/06/how-to-create-mailbox-in-exchange.html' title='How to create Mailbox in Exchange Server 2007 programmatically'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-6289424663009201288</id><published>2009-06-15T10:27:00.000-07:00</published><updated>2010-01-30T09:20:44.447-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programmatically'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='field type'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint 2007'/><title type='text'>Custom Field Type in SharePoint: Upload File, Image, Video</title><content type='html'>&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Custom Field Type: Upload File, Image, Video&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In this post I'll explain how you can create a custom field type, which enables end user to upload files, images and videos to document library and attach these files to pages in one step in edit properties of the page.&lt;br /&gt;I build this custom field type according to these requirements, which were:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;- The end user wants to attach a file to page in edit properties form.&lt;br /&gt;- The user doesn't want to go first to document library or image library and upload the file and then go back to edit form page and choose the file, he want to use Upload File Control to choose the file from his device in the edit properties form of the page directly.&lt;br /&gt;- The Admin wants to set the maximum size of files that user will upload.&lt;br /&gt;- The Admin wants to set the allowed extensions for uploaded files.&lt;br /&gt;- The Admin specify where these files will be stored inside the site.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Therefore I build a custom field type with these features:&lt;br /&gt;When you define a site column from Upload File Type, you&lt;br /&gt;- Set the URL of the site that contains the document library that you want to store files in.&lt;br /&gt;- Choose the document library that you want to store files in.&lt;br /&gt;- Set the allowed extensions.&lt;br /&gt;- Set the maximum file size.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The value of this field will be string, which represent the URL of the file. To build this custom field we should create the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;1. The Editor Control, which appear when you define the site column of this custom field type. In this editor we should save the URL of the site, the document library, allowed extensions and maximum file size as the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaHxfOF26I/AAAAAAAAACc/tqKda7wlTaY/s1600-h/1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5347617488660671890" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 439px; CURSOR: hand; HEIGHT: 256px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaNxeZJLZI/AAAAAAAAADU/O2haxGE-s5I/s320/8.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;This user control (Editor) should implements IFieldEditor and should inherit UserControl. So we should implement the InitializeWithField function and OnSaveChange as following:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;public void InitializeWithField(SPField field)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;fldUploadImageField = (UploadImageField)field;&lt;br /&gt;&lt;br /&gt;if (Page.IsPostBack) return;&lt;br /&gt;&lt;br /&gt;labelDescription.Text = ResourceManager.GetResource("labelDescription");&lt;br /&gt;labelDocLib.Text = ResourceManager.GetResource("ImagelabelDocLib");&lt;br /&gt;labelWebUrl.Text = ResourceManager.GetResource("labelWebUrl");&lt;br /&gt;labelExtensions.Text = ResourceManager.GetResource("labelExtensions");&lt;br /&gt;labelMaxFileSize.Text = ResourceManager.GetResource("labelMaxFileSize");&lt;br /&gt;txtMaxFileSize.Text = ResourceManager.GetResource("txtMaxFileSize"); // as default value to max size&lt;br /&gt;btnLoadDocLibs.Text = ResourceManager.GetResource("btnLoadDocLibs");&lt;br /&gt;&lt;br /&gt;if (field != null)&lt;br /&gt;{&lt;br /&gt;txtExtensions.Text = fldUploadImageField.AllowedExtensions;&lt;br /&gt;&lt;br /&gt;txtWebUrl.Text = fldUploadImageField.FieldToInsertLink;&lt;br /&gt;&lt;br /&gt;fillDocLibraries(ddlDocLib, txtWebUrl.Text.Trim());&lt;br /&gt;&lt;br /&gt;txtMaxFileSize.Text = fldUploadImageField.MaxFileSize;&lt;br /&gt;&lt;br /&gt;// set values from field properties&lt;br /&gt;ddlDocLib.SelectedValue = fldUploadImageField.DocumentLibraryName;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;labelError.Text += string.Format("Error in InitializeWithField: {0}&lt;br /&gt;", ex);&lt;br /&gt;}&lt;br /&gt;} &lt;/p&gt;2. Creating Field Class which inherits SPFieldText : this class represents the particular field and should contains a properties which represent URL, document library, files allowed extensions and maximum file size as following:&lt;br /&gt;&lt;br /&gt;public string DocumentLibraryName&lt;br /&gt;{&lt;br /&gt;get { return GetCustomProperty("DocumentLibraryName") + ""; }&lt;br /&gt;set { SetCustomProperty("DocumentLibraryName", value); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string FieldToInsertLink&lt;br /&gt;{&lt;br /&gt;get { return GetCustomProperty("FieldToInsertLink") + ""; }&lt;br /&gt;set { SetCustomProperty("FieldToInsertLink", value); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string AllowedExtensions&lt;br /&gt;{&lt;br /&gt;get { return GetCustomProperty("AllowedExtensions") + ""; }&lt;br /&gt;set { SetCustomProperty("AllowedExtensions", value); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string MaxFileSize&lt;br /&gt;{&lt;br /&gt;get { return GetCustomProperty("MaxFileSize") + ""; }&lt;br /&gt;set { SetCustomProperty("MaxFileSize", value); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;3. A field Control which should inherits from BaseFileFieldControl:&lt;br /&gt;In this class we should implement the following properties and functions:&lt;br /&gt;o Value Property: which is used to set and get the value of the field.&lt;br /&gt;o CreateChildControls: this function is used when the control is drawn in edit mode of the page or in edit properties form.&lt;br /&gt;This function will draw the control as following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_j8fYEYn1c_w/SjaIlpmTO9I/AAAAAAAAACk/_Mtm20c0P5g/s1600-h/2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5347611787952077778" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 375px; CURSOR: hand; HEIGHT: 104px" alt="" src="http://2.bp.blogspot.com/_j8fYEYn1c_w/SjaIlpmTO9I/AAAAAAAAACk/_Mtm20c0P5g/s320/2.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;o RenderFieldForDisplay: which is used when the page is in display mode, in this function if the file type is image, then we should render it as image tag and it'll appear in the page as following:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaJI_CbbxI/AAAAAAAAACs/q_RI8nDrypM/s1600-h/3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5347612395002621714" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 320px; CURSOR: hand; HEIGHT: 291px" alt="" src="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaJI_CbbxI/AAAAAAAAACs/q_RI8nDrypM/s320/3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And if the file is video, we should render it as object tag and it'll appear as following:&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5347613806162502450" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 270px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaKbIBKYzI/AAAAAAAAAC8/qcI50Cpy7z4/s320/5.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://1.bp.blogspot.com/_j8fYEYn1c_w/SjaJqta2uYI/AAAAAAAAAC0/DNuZuGy0EC8/s1600-h/5.jpg"&gt;&lt;/a&gt;And if the file is document, we should render it as link tag as following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5347614358666876610" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 66px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_j8fYEYn1c_w/SjaK7SQeFsI/AAAAAAAAADE/cnf_bjrqKzs/s320/6.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;o Validate: which is used to validate the value of the fields like maximum file size or validate on file extension.&lt;br /&gt;&lt;br /&gt;4.Xml file which contains the information that the WSS needs to correctly render the field as following :&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5347616429883487234" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 290px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaMz2I_dAI/AAAAAAAAADM/WOcO2fmZyJk/s320/7.jpg" border="0" /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-6289424663009201288?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/6289424663009201288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=6289424663009201288' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/6289424663009201288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/6289424663009201288'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2009/06/custom-field-type-in-sharepoint-upload.html' title='Custom Field Type in SharePoint: Upload File, Image, Video'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_j8fYEYn1c_w/SjaNxeZJLZI/AAAAAAAAADU/O2haxGE-s5I/s72-c/8.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1874849975900232494.post-2875062277813935619</id><published>2008-10-30T14:19:00.000-07:00</published><updated>2010-01-30T09:21:47.860-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programmatically'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='template'/><title type='text'>How to generate a template in SharePoint 2007 with solving all problems which will face...</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;How to generate a template in SharePoint 2007 and fix all problems you will face: &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;I have a task to create more than 5000 site from a temple, during my work, I faced many problems and I tried to solve them:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:0;"&gt;&lt;span style="FONT-WEIGHT: normal; LINE-HEIGHT: normal; FONT-STYLE: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;1. When we save a site as template, all sub sites don’t included in the template, so we should create a site programmatically and then create sub site inside it also programmatically as following: &lt;/span&gt;&lt;/p&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="Z-INDEX: 251658240;font-size:85%;" &gt;&lt;span style="LEFT: 21px; WIDTH: 527px; TOP: -1px; HEIGHT: 520px"&gt;&lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="BORDER-RIGHT: black 0.75pt solid; BORDER-TOP: black 0.75pt solid; BACKGROUND: white; VERTICAL-ALIGN: top; BORDER-LEFT: black 0.75pt solid; BORDER-BOTTOM: black 0.75pt solid; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial" width="546" bgcolor="white" height="262"&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;/div&gt;&lt;span style="Z-INDEX: 251658240"&gt;&lt;table style="WIDTH: 546px; HEIGHT: 443px" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;/div&gt;&lt;div style="PADDING-RIGHT: 7.95pt; PADDING-LEFT: 7.95pt; PADDING-BOTTOM: 4.35pt; PADDING-TOP: 4.35pt"&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;/div&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;private&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR: rgb(43,145,175)"&gt;SPWeb&lt;/span&gt; createSite(&lt;span style="COLOR: rgb(43,145,175)"&gt;SPWeb&lt;/span&gt; parentWeb, &lt;span style="color:blue;"&gt;string&lt;/span&gt; siteURLRequested, &lt;span style="color:blue;"&gt;string&lt;/span&gt; siteTitle, &lt;span style="color:blue;"&gt;string&lt;/span&gt; siteTemplateName, &lt;span style="color:blue;"&gt;int&lt;/span&gt; Language_ID, &lt;span style="color:blue;"&gt;bool&lt;/span&gt; useUniquePermissions, &lt;span style="color:blue;"&gt;bool&lt;/span&gt; inherentNavigation)&lt;/span&gt; &lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;{&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (parentWeb.Webs[siteURLRequested].Exists)&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;{&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;parentWeb.Webs.Delete(siteURLRequested);&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;}&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(43,145,175)"&gt;SPWeb&lt;/span&gt; newWeb = parentWeb.Webs.Add(siteURLRequested, siteTitle, &lt;span style="COLOR: rgb(163,21,21)"&gt;""&lt;/span&gt;, &lt;span style="COLOR: rgb(43,145,175)"&gt;Convert&lt;/span&gt;.ToUInt32(Language_ID), siteTemplateName, useUniquePermissions, &lt;span style="color:blue;"&gt;false&lt;/span&gt;);&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;newWeb.Navigation.UseShared = inherentNavigation;&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;newWeb.Update();&lt;/span&gt; &lt;/p&gt;&lt;p style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-ALIGN: left"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="LINE-HEIGHT: 115%;font-family:'Courier New';" &gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="Z-INDEX: 251658240;font-size:85%;" &gt;&lt;span style="LEFT: 21px; WIDTH: 546px; TOP: -1px; HEIGHT: 262px"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;2. When we create a site from a template, we encounter an error that the home page didn’t see its layout: To solve this problem we should create a new default page from empty web part layout.&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;So all default pages in the site and its sub sites should be created from a new layout or empty web part layout. &lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -0.25in"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:0;"&gt;3.&lt;span style="FONT-WEIGHT: normal; LINE-HEIGHT: normal; FONT-STYLE: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;3. When we have a content query web part in parent site and the web part display data from its sub sites, we will notice in our generated sites this web part don’t display data, because the ListGuid in the web part is wrong . &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;4. To solve this problem : we should detach the page from page layout then go to the web part and delete the ListGuid Attribute from web part and then our web part will work correctly, also this web part will display the data when we generate the site from template. &lt;/span&gt;&lt;/p&gt;&lt;p style="TEXT-INDENT: -0.25in"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:0;"&gt;4.&lt;span style="FONT-WEIGHT: normal; LINE-HEIGHT: normal; FONT-STYLE: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;For the Data Web Part , we should exchange the ListID with ListName in Select Parameter Tag. &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN-LEFT: 0.25in"&gt;&lt;span style="font-size:85%;"&gt;After you apply step 2, 3, and 4 , save your site and sub site as template , then generate site from that template and you will notice that your generated site will work correct. &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1874849975900232494-2875062277813935619?l=khaled-abrass.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khaled-abrass.blogspot.com/feeds/2875062277813935619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1874849975900232494&amp;postID=2875062277813935619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/2875062277813935619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1874849975900232494/posts/default/2875062277813935619'/><link rel='alternate' type='text/html' href='http://khaled-abrass.blogspot.com/2008/10/how-to-generate-template-in-sharepoint.html' title='How to generate a template in SharePoint 2007 with solving all problems which will face...'/><author><name>Khaled Abrass</name><uri>http://www.blogger.com/profile/16334783265236783892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_j8fYEYn1c_w/SzP3JRkQ65I/AAAAAAAAADk/7FoBm7Fs3Xw/S220/my+pic.jpg'/></author><thr:total>0</thr:total></entry></feed>
