<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Murat Akdeniz&#039;s Personel Web Site</title>
	<atom:link href="http://www.makdeniz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.makdeniz.com</link>
	<description></description>
	<lastBuildDate>Fri, 04 May 2012 19:24:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to copy SharePoint Site and its Content to Another Site</title>
		<link>http://www.makdeniz.com/how-to-copy-sharepoint-site-and-its-content-to-another-site/</link>
		<comments>http://www.makdeniz.com/how-to-copy-sharepoint-site-and-its-content-to-another-site/#comments</comments>
		<pubDate>Fri, 04 May 2012 19:12:24 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Export SharePoint Sites]]></category>
		<category><![CDATA[Export-SPWeb]]></category>
		<category><![CDATA[Import SharePoint Sites]]></category>
		<category><![CDATA[Import-SPWeb]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Save as Template]]></category>
		<category><![CDATA[SharePoint Lists]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=982</guid>
		<description><![CDATA[This is very important information. Because whenever you need to deploy something from your development environment to test or production environment, you will either use save site as template, which i never successfully did it , or you use following Powershell commands. It is very easy and i myself use all the time. Remember!  Powershell [...]]]></description>
			<content:encoded><![CDATA[<p>This is very important information. Because whenever you need to deploy something from your development environment to test or production environment, you will either use save site as template, which i never successfully did it , or you use following Powershell commands. It is very easy and i myself use all the time.</p>
<blockquote><p>Remember!  Powershell command can be use only at server that your sharePoint installed . Therefore, to do this action you have to have authority to access the server or you have to let server admin to do the job.</p></blockquote>
<p>Before you start, <span style="text-decoration: underline;">you must create the site that you will copy lists and contents</span>.</p>
<p>SharePoint 2010 Management Shell which you find at Start -&gt; All Programs -&gt; Microsoft SharePoint 2010 Products.</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/05/run-as-admin.png"><img class="alignnone size-full wp-image-993" title="run-as-admin" src="http://www.makdeniz.com/wp-content/uploads/2012/05/run-as-admin.png" alt="" width="370" height="140" /></a></p>
<p>Execute power shell and to export site write this command:</p>
<pre><span style="color: #0000ff;"><strong>Export-SPWeb</strong></span></pre>
<p>then powershell ask you identity. write downthis site url like http://sp2010/sites/mytestsite. Next it will ask you path, this this path of file that we will export content into. Write like C:\export.bak</p>
<p>when you hit the enter after a while you will see the export.bak file at C drive.</p>
<blockquote><p>Or shortly <code> -&gt;   Export-SPWeb -Identity &lt;Site Path&gt; -Path &lt;cmp File path&gt; <code></code></code></p>
<p><code><code>For example: Export-SPWeb -Identity http://sp2010/sites/mytestsite -Path C:\export.bak</code><br />
</code></p></blockquote>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/05/resultincmd.png"><img class="alignnone size-full wp-image-992" title="resultincmd" src="http://www.makdeniz.com/wp-content/uploads/2012/05/resultincmd.png" alt="" width="645" height="323" /></a></p>
<p>To import same procedure but different powershell command:</p>
<pre><span style="color: #0000ff;">Import-SPWeb</span></pre>
<blockquote><p>Or shortly <code> -&gt; Import-SPWeb -Identity &lt;Site Path&gt; -Path &lt;cmp File path&gt; <code></code></code></p>
<p><code><code>For example: Import-SPWeb -Identity http://sp2010/sites/myimportsite -Path C:\export.bak</code><br />
</code></p></blockquote>
<p>then powershell ask you identity. write downthis site url like http://sp2010/sites/myimportsite.  Next it will ask you path, this is the path of file that powershell  will use to import content.  Write like C:\export.bak</p>
<p>when you hit the enter after a while you will see that all list and its content there.</p>
<p>Honestly this is the most useful trick i have learned about SharePoint.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/how-to-copy-sharepoint-site-and-its-content-to-another-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the Day of Week by Infopath Rules &amp; Functions</title>
		<link>http://www.makdeniz.com/find-the-day-of-week-by-infopath-rules-functions/</link>
		<comments>http://www.makdeniz.com/find-the-day-of-week-by-infopath-rules-functions/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 09:46:06 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=941</guid>
		<description><![CDATA[Hi guys, This time i would like to share something that you can do with InfoPath rules and functions. Last week, i needed to use the name of day, but there is no function specific for this task, i thought it is not possible but after a little search i found out that with couple [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>This time i would like to share something that you can do with InfoPath rules and functions. Last week, i needed to use the name of day, but there is no function specific for this task, i thought it is not possible but after a little search i found out that with couple function and understanding of math of date it is possible. Here how i can made it:</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek1.jpg"><img class="wp-image-957 alignright" title="dayofweek1" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek1-300x202.jpg" alt="" width="300" height="202" /></a>1. Create a Date Picker control and a Text Box control, i named it , MyDate and DayOfWeek</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2.Using function below, replace &#8220;YourDateXPath&#8221; with you date picker xpath path name. exm: number(number(substring(../my:MyDate, 1, 4))</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek6.jpg"><img class="wp-image-962 alignright" title="dayofweek6" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek6-300x202.jpg" alt="" width="300" height="202" /></a>3.  Right click to DayOfWeek kontrol -&gt;TextBox Properties -&gt;Data -&gt; Default Value Section -&gt; Value click little fx button click  Edit Xpath (Advanced) check box and paste code.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>4.  Click OK -&gt; OK and you are about to done .</p>
<p>Now you will see only numbers from 0-7 that means 0 is Sunday, 1 is Monday, 2 Tuesday &#8230; Lets convert these numbers to day name.</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek2.jpg"><img class="size-medium wp-image-959 alignright" title="dayofweek2" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek2-300x202.jpg" alt="" width="300" height="202" /></a>5.  Click DayOfWeek control and select Manage Rules from home ribbon.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>6. Click new  to create a rule, then click action.</p>
<p>7.  Set field value</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek4.jpg"><img class="size-medium wp-image-961 alignright" title="dayofweek4" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek4-300x202.jpg" alt="" width="300" height="202" /></a>8.  Set  field DayOfWeek and value Sunday ( for 1 we will use Monday)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek5.jpg"><img class="size-medium wp-image-956 alignright" title="dayofweek5" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek5-300x202.jpg" alt="" width="300" height="202" /></a>9. Set condition  DayOfWeek Equal to 1</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>10. Repeat 6-9 for each day of week<a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek3.jpg"><img class="alignright" title="dayofweek3" src="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek3-300x202.jpg" alt="" width="300" height="202" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>11. you are done.</p>
<hr />
<pre class="brush: groovy; ">

(number(substring(&quot;YourDateXPath&quot;, 9, 2)) + number(number(substring(&quot;YourDateXPath&quot;, 1, 4)) - (floor((14 - number(substring(&quot;YourDateXPath&quot;, 6, 2))) div 12))) + floor(number(number(substring(&quot;YourDateXPath&quot;, 1, 4)) - (floor((14 - number(substring(&quot;YourDateXPath&quot;, 6, 2))) div 12))) div 4) - floor(number(number(substring(&quot;YourDateXPath&quot;, 1, 4)) - (floor((14 - number(substring(&quot;YourDateXPath&quot;, 6, 2))) div 12))) div 100) + floor(number(number(substring(&quot;YourDateXPath&quot;, 1, 4)) - (floor((14 - number(substring(&quot;YourDateXPath&quot;, 6, 2))) div 12))) div 400) + floor((31 * number(number(substring(&quot;YourDateXPath&quot;, 6, 2)) + 12 * (floor((14 - number(substring(&quot;YourDateXPath&quot;, 6, 2))) div 12)) - 2)) div 12)) mod 7
</pre>
<hr />
<a href="http://www.makdeniz.com/wp-content/uploads/2012/02/dayofweek.rar" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download Demo Source</span></a>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/find-the-day-of-week-by-infopath-rules-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate difference between two dates excluding Sunday or any day with CSharp</title>
		<link>http://www.makdeniz.com/calculate-difference-between-two-dates-excluding-sunday-or-any-day-with-csharp/</link>
		<comments>http://www.makdeniz.com/calculate-difference-between-two-dates-excluding-sunday-or-any-day-with-csharp/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 07:15:05 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[cSharp]]></category>
		<category><![CDATA[TimeSpan]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=889</guid>
		<description><![CDATA[.Net is really great environment, a lot of functionality has already been implemented  and ready to use. Its just one dot away. Here  for example, you don&#8217;t need to implement anything to find the day of date just use DayOfWeek function. private Int32 NoOfDates(DateTime StartDate, DateTime EndDate) { //difference between two dates TimeSpan diff= EndDate- [...]]]></description>
			<content:encoded><![CDATA[<p>.Net is really great environment, a lot of functionality has already been implemented  and ready to use. Its just one dot away. Here  for example, you don&#8217;t need to implement anything to find the day of date just use DayOfWeek function.</p>
<p><span id="more-889"></span></p>
<pre class="brush: csharp; ">

private Int32 NoOfDates(DateTime StartDate, DateTime EndDate)
{
//difference between two dates
TimeSpan diff= EndDate- StartDate;
//Correct number of days by adding 1
int TDates = Diff.Days + 1;

int NoOfSundays = 0;

for (int i = 1; i &lt;= TDates ; i++)
{
//Instead Sunday we can use any day of week exmp. DayOfWeek.Friday
if (StartDate.DayOfWeek == DayOfWeek.Sunday)
{
NoOfSundays++;
}
//Add one day to startdate to see if next day is Sunday
StartDate= StartDate.AddDays(1);
}

return NoOfSundays;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/calculate-difference-between-two-dates-excluding-sunday-or-any-day-with-csharp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortcut for &#8220;Save As Template&#8221; in SharePoint 2010</title>
		<link>http://www.makdeniz.com/shortcut-for-save-as-template-in-sharepoint-2010/</link>
		<comments>http://www.makdeniz.com/shortcut-for-save-as-template-in-sharepoint-2010/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 13:36:21 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Save as Template]]></category>
		<category><![CDATA[Template]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=882</guid>
		<description><![CDATA[Most of the time we use test and production server. Then we create list and libraries at test server and copy or miserably create again. To copy whole site, save as template feature is used. When publishing feature is enabled save as template link disappear but we can reach this feature by manually using sharepointsite/_layouts/SaveTmpl.aspx [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the time we use test and production server. Then we create list and libraries at test server and copy or miserably create again. To copy whole site, save as template feature is used.<br />
When publishing feature is enabled save as template link disappear but we can reach this feature by manually using</p>
<p>sharepointsite/_layouts/SaveTmpl.aspx</p>
<p>exam. http:\\www.sharepointtest/team/_layouts/SaveTmpl.aspx</p>
<p><img class="alignnone size-full wp-image-883" title="savetemplate" src="http://www.makdeniz.com/wp-content/uploads/2012/02/savetemplate.png" alt="" width="696" height="446" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/shortcut-for-save-as-template-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Filter SharePoint 2010 Tasks Which are Assigned to You and The Group Your are Member of?</title>
		<link>http://www.makdeniz.com/how-to-filter-sharepoint-2010-tasks-which-are-assigned-to-you-and-the-group-your-are-member-of/</link>
		<comments>http://www.makdeniz.com/how-to-filter-sharepoint-2010-tasks-which-are-assigned-to-you-and-the-group-your-are-member-of/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 18:15:29 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[CAML]]></category>
		<category><![CDATA[Filter Lists]]></category>
		<category><![CDATA[SharePoint Lists]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=752</guid>
		<description><![CDATA[Normally we use standard view to filter assigned tasks by using [Me] in filter option. But you can use only [Me] and [Today]. What you can do if you want to see tasks which is assigned to you and tasks which are assigned to a SharePoint group that you are member of. This is actually [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-755" title="filter1" src="http://www.makdeniz.com/wp-content/uploads/2012/01/filter1.jpg" alt="" width="400" height="281" />Normally we use standard view to filter assigned tasks by using [Me] in filter option. But you can use only [Me] and [Today]. What you can do if you want to see tasks which is assigned to you and tasks which are assigned to a SharePoint group that you are member of.</p>
<p>This is actually very easy step. But you have to use SharePoint designer  to do this.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Step 1</h3>
<hr />
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/01/filter4.jpg"><img class="size-thumbnail wp-image-758 alignleft" title="filter4" src="http://www.makdeniz.com/wp-content/uploads/2012/01/filter4-150x150.jpg" alt="" width="150" height="150" /></a> Open SharePoint designer then open site that you want to study.  Select the task list or any list that you want to filter.  When you select task list you will see a panel right site of designer called views. Then select the view that we will modify.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Step 2</h3>
<hr />
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/01/filter3.jpg"><img class="alignright size-thumbnail wp-image-756" title="filter3" src="http://www.makdeniz.com/wp-content/uploads/2012/01/filter3-150x150.jpg" alt="" width="150" height="150" /></a>If you can not edit file you must select advanced edit mode</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Step 3</h3>
<hr />
<p><a href="http://www.makdeniz.com/wp-content/uploads/2012/01/filter2.jpg"><img class="alignleft size-thumbnail wp-image-757" title="filter2" src="http://www.makdeniz.com/wp-content/uploads/2012/01/filter2-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>In source view search for <span style="color: #ff0000;">&lt;Query&gt;</span> and you will see view query. If you already modify view as filtered by [Me] you are going to see more or less query as shown in picture.  Modify this query string with code given below. that&#8217;s how user can see tasks which are assigned to him or his group.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Finally</h3>
<hr />
<p>The key ingredient is &#8220;CurrentUserGroups&#8221;. Now you can modify any list and make different types of filter. This query syntax called CAML. If you study little bit, then  you can make complex query or what ever you want.</p>
<p>I hope this tutorial help you.</p>
<p>&nbsp;</p>
<pre class="brush: csharp; ">

&lt;Query&gt;
&lt;Where&gt;
&lt;Or&gt;
&lt;And&gt;
&lt;Eq&gt;
&lt;FieldRef Name=&quot;AssignedTo&quot;/&gt;&lt;Value Type=&quot;Integer&quot;&gt;&lt;UserID/&gt;&lt;/Value&gt;
&lt;/Eq&gt;
&lt;IsNull&gt;
&lt;FieldRef Name=&quot;WorkflowOutcome&quot;/&gt;
&lt;/IsNull&gt;
&lt;/And&gt;
&lt;And&gt;
&lt;Membership Type=&quot;CurrentUserGroups&quot;&gt;&lt;FieldRef Name=&quot;AssignedTo&quot;/&gt;&lt;/Membership&gt;
&lt;IsNull&gt;
&lt;FieldRef Name=&quot;WorkflowOutcome&quot;/&gt;
&lt;/IsNull&gt;
&lt;/And&gt;
&lt;/Or&gt;
&lt;/Where&gt;
&lt;/Query&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/how-to-filter-sharepoint-2010-tasks-which-are-assigned-to-you-and-the-group-your-are-member-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CRUD Operations on SharePoint Lists using Microsoft.SharePoint.Linq</title>
		<link>http://www.makdeniz.com/crud-operations-on-sharepoint-lists-using-microsoft-sharepoint-linq/</link>
		<comments>http://www.makdeniz.com/crud-operations-on-sharepoint-lists-using-microsoft-sharepoint-linq/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 13:54:20 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Crud]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Linq to Sharepoint]]></category>
		<category><![CDATA[SharePoint Lists]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=657</guid>
		<description><![CDATA[everybody, In this tutorial, i would like to share with you a cool stuff called Linq to SharePoint. It a new way to write queries. If you already bored by Caml syntax, i definitely suggest you to use Linq to SharePoint . Before we start lets take a look at some quick info. What is [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">Hi</span><!--/.dropcap--> everybody,<br />
In this tutorial, i would like to share with you a cool stuff called Linq to SharePoint. It a new way to write queries. If you already bored by Caml syntax, i definitely suggest you to use Linq to SharePoint . Before we start lets take a look at some quick info.</p>
<blockquote><p>What is Linq?<br />
Language Integrated Query (LINQ, pronounced &#8220;link&#8221;) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages<br />
LINQ is a new data access paradigm which allows users to express SQL like syntax against a variety of data sources. LINQ can improve performance by allowing the back end data source to decide the best way to solve the query.</p></blockquote>
<blockquote><p>What is LINQ to SharePoint?<br />
It is a entegration for sharepoint lists to make queriny simple query and alternative of Caml systax. SharePoint now fully supports LINQ for querying lists so that you can query information from the platform in a more condensed, easier to understand format.</p></blockquote>
<blockquote><p>What is SPMetal.exe?</p>
<p>SPMetal is a command-line tool that generates <a href="http://msdn.microsoft.com/en-us/library/ie/ee536692.aspx">entity classes</a>, which provide an object-oriented interface to the Microsoft SharePoint Foundation content databases. These classes are primarily used in LINQ to SharePoint queries; but they are also used to add, delete, and change list items with concurrency conflict resolution. Finally, they can be used as an alternative to the regular SharePoint Foundation object model for referencing content.</p>
<p>SPMetal is typically executed as a prebuild command in Microsoft Visual Studio because the code it generates is usually part of a solution that includes a new site type that is itself evolving during the development cycle. Because SPMetal overwrites the files it generates with each execution, for a given output path and against a given Web site, you should not make changes to these files. The classes it generates are partial, so you can add members to them in separate, manually created, code files.</p>
<p>&nbsp;</p></blockquote>
<p>In order to work with LINQ in SharePoint 2010, we have to use a tool called SPMetal.exe You can find this file under &#8220;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\bin&#8221; . We are going to use this file to create some entity classes which Visual Studio 2010 can use to get IntelliSense. It will also allow for LINQ-based queries to be run on your lists. To do this you should use following statement to create entity class file.</p>
<pre class="brush: sql; ">

spmetal.exe /web:http://SharepointTest/MySite/ /namespace:MyLinq /code:Mylinq.cs
</pre>
<p>If your solution is based on an existing site type, such as the Team Site that is included with SharePoint Foundation, and it references only lists that are always present in such sites and only fields (columns) that are always present in those lists, you can run SPMetal just once and make changes to the generated file that will not be overwritten.I used a batch file to create entity-classes CreateLinq.bat. Because whenever I create new list or add new column, I must update entity class to use lists and columns. Instead writing every time I needed to update my entitiy class I use only double click.</p>
<pre class="brush: sql; ">

spmetal.exe /web:http://SharepointTest/MySite/ /namespace:MyLinq /code:Mylinq.cs /code:MyLinq.cs
pause
</pre>
<p>We created entity class file now it is time to add Microsoft.Sharepoint.Linq reference.<br />
<img class="size-full wp-image-690 alignnone" title="reference" src="http://www.makdeniz.com/wp-content/uploads/2012/01/reference.png" alt="" width="537" height="438" /></p>
<p>Make sure that you use using statement for system.linq and sharepoint.linq</p>
<pre class="brush: csharp; ">

using System.Linq;
using Microsoft.SharePoint.Linq;
using MyLinq;
</pre>
<p>Lets get down to coding</p>
<h3>Create a item</h3>
<hr />
<pre class="brush: csharp; ">

MylinqDataContext context = new MylinqDataContext(&quot;http://SharepointTest/MySite&quot;);
EntityList&lt;SampleDataItem&gt; sampledatalist = context.GetList&lt;SampleDataItem&gt;(&quot;SampleData&quot;);
SampleDataItem itemToInsert = new SampleDataItem()
   {
     Title= &quot;Demo Title&quot;
   };
sampledatalist.InsertOnSubmit(itemToInsert);
context.SubmitChanges();
</pre>
<p>To create an item first create context object using properties of MyLinq file we have created above. Second, get items of SampleData list assign to &#8220;sampledatalist&#8221;. We create a object named itemToInsert which is SampleDataItem object and set field of item that we will create. Then we push the value of itemToInsert object to sampledata and finally submit changes to context.</p>
<h3>Read item from List</h3>
<hr />
<pre class="brush: csharp; ">

MylinqDataContext context = new MylinqDataContext (&quot;http://SharepointTest/MySite&quot;);

var sampQuery = from samp in SampleData select samp;

GridView1.DataSource = sampQuery;
GridView1.DataBind();
</pre>
<p>Using context we query for data. Use this data as a datasource for gridview. Finally bind datasource to gridview and there you go. If you set autogeneratecolumns=&#8221;true&#8221; you will see every every column in your list.</p>
<h3>Update one List item</h3>
<hr />
<pre class="brush: csharp; ">

MylinqDataContext context = new MylinqDataContext (&quot;http://SharepointTest/MySite&quot;);

var itemToUpdate = (from r in context.SampleData where r.Rep == TextBox2.Text select r).First();
itemToUpdate.Title = &quot;Update with this text&quot;;
context.SubmitChanges();
</pre>
<p>Again using context which is our entity class query for the certain item. We do this by First() . Then set the value of Title and finally submit changes to context.</p>
<h3>Update multiple List items</h3>
<hr />
<pre class="brush: csharp; ">

MlinqDataContext context = new MlinqDataContext(&quot;http://SharepointTest/MySite&quot;);

var itemToUpdate = from r in context.SampleData where r.Rep == TextBox5.Text select r;
foreach(var t in itemToUpdate)
   {
     t.Title = TextBox6.Text;
    }
context.SubmitChanges();
</pre>
<p>I think you already understand the idea of DataContext. First we query for list item that we will update. Using foreach statement we are you to manipulate every single one of them. Here i am using TextBox6 value to set Title field. Lastly submit changes to context.</p>
<h3>Delete List item</h3>
<hr />
<pre class="brush: csharp; ">

MylinqDataContext context = new MylinqDataContext (&quot;http://SharepointTest/MySite&quot;);

EntityList&lt;SampleDataItem&gt; sampledata= context.GetList&lt;SampleDataItem&gt;(&quot;SampleData&quot;);
var itemToDelete = (from r in context.SampleData
                           where r.Id == Convert.ToInt32(TextBox4.Text) select r).First();
sampledata.DeleteOnSubmit(itemToDelete);
context.SubmitChanges();
</pre>
<p>Here there is one more row different than other is that we have sampladata entity list. We used because fist query for list item to delete, then we say delete these item from sampledata list. Then using deleteonsubmit set the items that will be deleted in sampledata list and submit changes to context.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/crud-operations-on-sharepoint-lists-using-microsoft-sharepoint-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is How I Draw Cartoon</title>
		<link>http://www.makdeniz.com/this-is-how-i-draw-cartoon/</link>
		<comments>http://www.makdeniz.com/this-is-how-i-draw-cartoon/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 19:04:20 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[My Favorites]]></category>
		<category><![CDATA[Cartoon]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=619</guid>
		<description><![CDATA[In this post, i would like to share with you, how i draw some of my cartoons that you can see at My Cartoons page. To draw cartoon i use following tools: Tablet Adobe Illustrator to draw Adobe Photoshop to colorize]]></description>
			<content:encoded><![CDATA[<p>In this post, i would like to share with you, how i draw some of my cartoons that you can see at My Cartoons page.</p>
<p><span id="more-619"></span></p>
<p>To draw cartoon i use following tools:</p>
<ul>
<li>Tablet</li>
<li>Adobe Illustrator to draw</li>
<li>Adobe Photoshop to colorize</li>
</ul>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2011/12/Untitled-21.png"><img class="wp-image-634 alignnone" title="cartoon b&amp;w" src="http://www.makdeniz.com/wp-content/uploads/2011/12/Untitled-21.png" alt="" width="321" height="312" /></a><a href="http://www.makdeniz.com/wp-content/uploads/2011/12/Untitled-2.png"> <img class=" wp-image-635 alignnone" title="Cartoon colored" src="http://www.makdeniz.com/wp-content/uploads/2011/12/Untitled-2.png" alt="" width="317" height="307" /></a></p>
<hr />
<p><iframe src="http://www.youtube.com/embed/ccubjHvI4dY?hd=1" frameborder="0" width="793" height="448"></iframe></p>
<hr />
<a href="http://www.makdeniz.com/wp-content/uploads/2012/01/cartoon.rar" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download PSD</span></a>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/this-is-how-i-draw-cartoon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Sum Multiple Same Class Input Values by jQuery</title>
		<link>http://www.makdeniz.com/how-to-sum-multiple-same-class-input-values-by-jquery/</link>
		<comments>http://www.makdeniz.com/how-to-sum-multiple-same-class-input-values-by-jquery/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 09:39:07 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=532</guid>
		<description><![CDATA[jQuery is very cool library, you can do so many things faster than normal javascript, here is one example: If you have multiple input and all of them have same class, you can sum of their value and more. &#8220;each&#8221; function does everything. Take a look at codes below. Script &#60;script type=&#34;text/javascript&#34;&#62; function sum(classname) { [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery is very cool library, you can do so many things faster than normal javascript, here is one example: If you have multiple input and all of them have same class, you can sum of their value and more. &#8220;each&#8221; function does everything. Take a look at codes below.</p>
<p><span id="more-532"></span></p>
<h3>Script</h3>
<pre class="brush: js; ">

&lt;script type=&quot;text/javascript&quot;&gt;
function sum(classname)
 {
    $(&quot;.&quot;+classname+&quot;sum&quot;).val(0);
    var sum = 0;
    $(&quot;.&quot;+classname).each(function()
       {
          if(!isNaN(this.value) &amp;&amp;  this.value.length!=0)
             {
                sum += parseFloat(this.value);
             }
        });

   $(&quot;.&quot;+classname+&quot;sum&quot;).val(sum);
 }
&lt;/script&gt;
</pre>
<h3>Html</h3>
<pre class="brush: html; ">

Sum:&lt;input type=&quot;text&quot; /&gt;
Value1:&lt;input type=&quot;text&quot; /&gt;
Value2:&lt;input type=&quot;text&quot; /&gt;
Value3:&lt;input type=&quot;text&quot; /&gt;
Value4:&lt;input type=&quot;text&quot; /&gt;
&lt;input onclick=&quot;sum(&#039;classname&#039;);&quot; type=&quot;button&quot; value=&quot;Sum&quot; /&gt;
</pre>
<hr />
<p><a href="#" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download Source</span></a> <a target="_blank" href="http://www.makdeniz.com/source/input_sum/index.htm" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Demo</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/how-to-sum-multiple-same-class-input-values-by-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make Moving Background Image with jQuery</title>
		<link>http://www.makdeniz.com/how-to-make-moving-background-image-with-jquery/</link>
		<comments>http://www.makdeniz.com/how-to-make-moving-background-image-with-jquery/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 16:27:06 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Moving Background Image]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=487</guid>
		<description><![CDATA[Hi everybody, this time I&#8217;ll give you a hint about moving background image. Depending on your background image you can move anything .  It is not the perfect solution but, it will help to make some move&#8230; Html Codes How to Make Moving Background Image with jQuery Styles .warper { border: 4px solid #026b8e; margin-left: [...]]]></description>
			<content:encoded><![CDATA[<p><img title="movingback" src="http://www.makdeniz.com/wp-content/uploads/2011/12/movingback.png" alt="" width="839" height="359" /></p>
<p>Hi everybody, this time I&#8217;ll give you a hint about moving background image. Depending on your background image you can move anything <img src='http://www.makdeniz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  It is not the perfect solution but, it will help to make some move&#8230;</p>
<p><span id="more-487"></span></p>
<h3>Html Codes</h3>
<div class="warper">
<h1>How to Make Moving Background Image with jQuery</h1>
</div>
<h3>Styles</h3>
<pre class="brush: css; ">
.warper
{
border: 4px solid #026b8e;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
padding: 0;
width: 750px;
overflow: hidden;
left:50%;
height:800px;
background-color: #fff;
}

body
{
height: 100%;
padding: 0;
margin: 0;
background: #fff url(back2.jpg) repeat-x scroll left top;
background-color: #fff !important;
}
</pre>
<h3>JavaScript</h3>
<pre class="brush: js; ">

&lt;script charset=&quot;utf-8&quot; type=&quot;text/javascript&quot; src=&quot;jquery-1.6.2.js&quot;&gt;&lt;/script&gt;
&lt;script charset=&quot;utf-8&quot; type=&quot;text/javascript&quot;&gt;
var scrollSpeed = 60; // Speed in milliseconds
var step = 1; // How many pixels to move per step
var current = 0; // The current pixel row
var imageWidth = 1024; // Background image width
var headerWidth = 280; // How wide the header is.

//The pixel row where to start a new loop
var restartPosition = -(imageWidth - headerWidth);

function scrollBg(){
//Go to next pixel row.
current -= step;

//If at the end of the image, then go to the top.
if (current == restartPosition){
current = 0;
}

//Set the CSS of the header.
$(&#039;body&#039;).css(&quot;background-position&quot;,current+&quot;px 0&quot;);
}

//Calls the scrolling function repeatedly
var init = setInterval(&quot;scrollBg()&quot;, scrollSpeed);
&lt;/script&gt;
</pre>
<hr />
<pre><a href="http://www.makdeniz.com/source/moving_background/moving_background.zip" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download Sorce</span></a> <a href="http://www.makdeniz.com/source/moving_background/index.htm" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Demo</span></a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/how-to-make-moving-background-image-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Bulk Import Documents to SharePoint 2010 Document Library</title>
		<link>http://www.makdeniz.com/how-to-bulk-import-documents-to-sharepoint-2010-document-library/</link>
		<comments>http://www.makdeniz.com/how-to-bulk-import-documents-to-sharepoint-2010-document-library/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 14:04:19 +0000</pubDate>
		<dc:creator>Murat Akdeniz</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Bulk Document Import]]></category>
		<category><![CDATA[SharePoint Document Library]]></category>

		<guid isPermaLink="false">http://www.makdeniz.com/?p=444</guid>
		<description><![CDATA[Recently, i was working on project that manages incoming and outgoing documents. I was trying to move massive numbers of documents from file server to SharePoint document library. To do this first i tried to use &#8220;Upload Multiple Document&#8221; button on document library, i was faced by item limit of 100 documents. Then i decided use [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, i was working on project that manages incoming and outgoing documents. I was trying to move massive numbers of documents from file server to SharePoint document library.</p>
<p>To do this first i tried to use &#8220;Upload Multiple Document&#8221; button on document library, i was faced by item limit of 100 documents. Then i decided use SharePoint Designer, but again i was hit by failure. Because designer upload limit was 40MB.  Instead try to increase to limits from central administration, by the way it is bit of hard to convince the SharePoint admin to increase limits, i try to implement something by Microsoft SharePoint Client model then i realized that someone already done it.</p>
<p>&#8220;<a href="http://spbulkdocumentimport.codeplex.com/">SharePoint 2010 Bulk Document Importer</a>&#8221; by Orbit One Internet Solutions and even it is <span style="text-decoration: underline;">Open Source</span>.</p>
<p>I used it, it is very useful application.</p>
<h3><img class="size-full wp-image-467 alignright" title="Bulk import" src="http://www.makdeniz.com/wp-content/uploads/2011/12/logging2.png" alt="" width="677" height="342" /></h3>
<h3></h3>
<h3></h3>
<h3>How to use?</h3>
<div>Command-line optionsAs you&#8217;re starting the program from a DOS prompt:<strong>OrbitOne.SharePoint.Importer.exe -folder:folder -site:url -documenlibrary:name [-createfolders] [-createemptyfolders] [-archive:folder] [-username -password -domain] [-authenticationmode:[Windows|Forms]]</strong>Required arguments:<strong>-folder</strong>: The folder that will be imported<br />
<strong>-site</strong>: The url of the SharePoint Site<br />
<strong>-documentlibrary</strong>: The name of the Document Library<strong>Example</strong><br />
<strong>OrbitOne.SharePoint.Importer.exe -folder:&#8221;\\fileshare\2010\documentation&#8221; -site:&#8221;http://intranet/2010&#8243; -documentlibrary:&#8221;user guides&#8221;</strong></p>
<p>This will process all files in the folder <strong>\\fileshare\2010\documentation</strong> and import them to the document library <strong>user guides</strong> on the SharePoint site <strong>http://intranet/2010</strong></p>
<hr />
<p><strong>-archive:folder</strong>:</p>
<blockquote><p>The folder that processed files will be moved to. Files will be moved to the archive. Folders will never be removed.</p></blockquote>
<p><strong>Example</strong></p>
<blockquote><p>OrbitOne.SharePoint.Importer.exe -folder:&#8221;\\fileshare\2010\documentation&#8221; -site:&#8221;http://intranet/2010&#8243; -documentlibrary:&#8221;user guides&#8221; <strong>-archive:&#8221;\\fileshare\migrated\2010&#8243;</strong></p></blockquote>
<blockquote><p>Import all files and move them to the folder \\fileshare\migrated\2010. This folder needs to be empty when the import is started</p></blockquote>
<hr />
<p><strong>-createfolders -createemptyfolders</strong></p>
<blockquote><p>If specified folders will be created in the document library. empty folders are skipped by default but will be created when the &#8220;-createemptyfolders&#8221; argument is specified</p></blockquote>
<p><strong>Example</strong></p>
<blockquote><p>OrbitOne.SharePoint.Importer.exe -folder:&#8221;\\fileshare\2010\documentation&#8221; -site:&#8221;http://intranet/2010&#8243; -documentlibrary:&#8221;user guides&#8221; <strong>-createfolders</strong> -createemptyfolders</p></blockquote>
<hr />
<p><strong>-importhiddenfiles</strong></p>
<blockquote><p>When specified hidden files will be imoprted. By default they are skipped.</p></blockquote>
<hr />
<p><strong>-username -password -domain</strong></p>
<blockquote><p>Credentials that will be used to connect to SharePoint.</p></blockquote>
<p><strong>Example</strong></p>
<blockquote><p>OrbitOne.SharePoint.Importer.exe -folder:&#8221;\\fileshare\2010\documentation&#8221; -site:&#8221;http://intranet/2010&#8243; -documentlibrary:&#8221;user guides&#8221; <strong>-username:Administrator -password:</strong>******* -domain:litwareinc*</p></blockquote>
<blockquote><p>This will connect to SharePoint as litwareinc\Administrator. If no credentials are specified the credentials of the current user are used.</p></blockquote>
<hr />
<p><strong>-authenticationmode</strong></p>
<blockquote><p>Windows or Forms. Windows is used is no authentication mode is specified</p></blockquote>
<p><strong>Example</strong></p>
<blockquote><p>OrbitOne.SharePoint.Importer.exe -folder:&#8221;\\fileshare\2010\documentation&#8221; -site:&#8221;http://intranet/2010&#8243; -documentlibrary:&#8221;user guides&#8221; -username:admin -password:******** <strong>-authenticationmode:Forms</strong></p></blockquote>
<blockquote><p>This will connect to SharePoint as the user &#8220;admin&#8221;, using Forms authentication</p></blockquote>
<p>For further information: <a href="http://spbulkdocumentimport.codeplex.com">http://spbulkdocumentimport.codeplex.com/</a></p>
</div>
<div class="woo-sc-hr"></div>
<p><a href="http://www.makdeniz.com/wp-content/uploads/2011/12/bulkimporter.rar" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download Application</span></a> <a href="http://www.makdeniz.com/wp-content/uploads/2011/12/bulkimporterSource.zip" class="woo-sc-button  custom" style="background:;border-color:"><span class="woo-">Download SourceCode</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makdeniz.com/how-to-bulk-import-documents-to-sharepoint-2010-document-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

