<?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>Troy Scott's Web Blog &#187; .net</title>
	<atom:link href="http://troyscott.ca/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://troyscott.ca</link>
	<description></description>
	<lastBuildDate>Mon, 17 Oct 2011 22:30:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Cannot start service SPUserCodeV4 on computer</title>
		<link>http://troyscott.ca/2010/08/06/cannot-start-service-spusercodev4-on-computer/</link>
		<comments>http://troyscott.ca/2010/08/06/cannot-start-service-spusercodev4-on-computer/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 07:27:17 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://troyscott.ca/2010/08/06/cannot-start-service-spusercodev4-on-computer/</guid>
		<description><![CDATA[This week I was creating my first SharePoint 2010 Sandboxed solution using Visual Studio 2010.&#160; I have successfully built and deployed other SharePoint projects on the server but I always used Farm based solution due to the requirements. When I built the Sandboxed solution the project would build and package without any errors but when [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was creating my first SharePoint 2010 Sandboxed solution using Visual Studio 2010.&#160; I have successfully built and deployed other SharePoint projects on the server but I always used Farm based solution due to the requirements.</p>
<p>When I built the Sandboxed solution the project would build and package without any errors but when I tried to deploy it to the SharePoint site the following error occurred:</p>
<p><em>Error&#160;&#160;&#160; 1&#160;&#160;&#160; Error occurred in deployment step &#8216;Activate Features&#8217;: Cannot start service SPUserCodeV4 on computer &#8216;SERVERNAME&#8217; 0&#160;&#160;&#160; 0&#160;&#160;&#160; SP2010Dev1</em></p>
<p>The error can be easily resolved by starting the <em>Microsoft SharePoint Foundation Sandboxed Code Service </em>which can be accessed through the Central Administration site in SharePoint.&#160;&#160; Open the Central Administration site and go to System Settings and click on <em>Manage Service on server:</em></p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb5.png" width="244" height="114" /></a> </p>
<p>Check to see if <em>Microsoft SharePoint Foundation Sandboxed Code Service</em>&#160; is running, it should be stopped :</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb6.png" width="244" height="135" /></a> </p>
<p>Start the service and try deploying the Sandboxed solution.</p>
<p>Thanks to <a href="http://social.msdn.microsoft.com/profile/sergey%20hyper%20kravchenko/?type=forum&amp;referrer=http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/2af4352a-7379-44c8-99e3-0a33ed1a1db1">Sergey Hyper Kravchenko</a> for his post on the MSDN SharePoint discussion forum:</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/2af4352a-7379-44c8-99e3-0a33ed1a1db1" target="_blank"><em>error occurred in deployment step &#8216;retract solution&#8217; cannot start service SPUserCodeV4 on this computer</em></a></p>
<p>Troy</p>
]]></content:encoded>
			<wfw:commentRss>http://troyscott.ca/2010/08/06/cannot-start-service-spusercodev4-on-computer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running Visual Studio 2010 as Administrator</title>
		<link>http://troyscott.ca/2010/08/05/running-visual-studio-2010-as-administrator/</link>
		<comments>http://troyscott.ca/2010/08/05/running-visual-studio-2010-as-administrator/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 01:49:28 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://troyscott.ca/2010/08/05/running-visual-studio-2010-as-administrator/</guid>
		<description><![CDATA[If you are using Windows 7 or Windows Server 2008 and you try to create a project once Visual Studio has been opened you may receive the following message: This task requires the application to have elevated permissions If this occurs you have two options: Right-click on the Visual Studio 2010 Shortcut Hold down the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Windows 7 or Windows Server 2008 and you try to create a project once Visual Studio has been opened you may receive the following message:</p>
<p><em>This task requires the application to have elevated permissions</em></p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb.png" width="244" height="140" /></a> </p>
<p>If this occurs you have two options:</p>
<p><em><u>Right-click on the Visual Studio 2010 Shortcut</u></em></p>
<p>Hold down the SHIFT key and right click the shortcut:</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb1.png" width="200" height="244" /></a> </p>
<p>Select <em>Run as administrator </em>and when you try to create project it will work.&#160;&#160; The downside of this approach is that you have to do this every time you want to run Visual Studio.</p>
<p><em><u>Set the Visual Studio Shortcut Properties to Run As Administrator</u></em></p>
<p>Hold down the SHIFT key and right click the shortcut:</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb2.png" width="212" height="244" /></a>&#160;</p>
<p>Select properties and then click on the&#160; Compatibility tab.&#160; In the Privilege level section select the <em>Run this program as an administrator </em>check box.</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb3.png" width="195" height="244" /></a>&#160;</p>
<p>Click Apply and when you double click the shortcut next time the program will run with Administrative privileges.&#160;&#160; However, you will receive a <em>User Account Control </em>notification when the program is run:</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2010/08/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2010/08/image_thumb4.png" width="244" height="131" /></a> </p>
<p>Troy</p>
]]></content:encoded>
			<wfw:commentRss>http://troyscott.ca/2010/08/05/running-visual-studio-2010-as-administrator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update requires a valid UpdateCommand when passed DataRow collection &#8230;</title>
		<link>http://troyscott.ca/2009/10/29/update-requires-a-valid-updatecommand-when-passed-datarow-collection/</link>
		<comments>http://troyscott.ca/2009/10/29/update-requires-a-valid-updatecommand-when-passed-datarow-collection/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:05:05 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://troyscott.ca/2009/10/29/update-requires-a-valid-updatecommand-when-passed-datarow-collection/</guid>
		<description><![CDATA[&#160; I have been creating an application for work over the last couple of days which requires ADO.Net.&#160; I work in the Business Intelligence field so I do not code verify often unless I need a custom script for an SSIS package.&#160; Most of the Microsoft BI products just require a solid understanding of SQL [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>I have been creating an application for work over the last couple of days which requires ADO.Net.&#160; I work in the Business Intelligence field so I do not code verify often unless I need a custom script for an SSIS package.&#160; Most of the Microsoft BI products just require a solid understanding of SQL or MDX and of course the customers business requirements.&#160;&#160; While creating the application I ran into the following error when updating the databases with changes in the dataset.&#160; I am using Visual Studio 2008 Express Edition and the database is a Compact Database.&#160; </p>
<p>I only received the error when I tried to update a record in the database.&#160; If I added a new record (INSERT) and saved my changes the application worked fine.&#160; Below is a screenshot of the simple app:</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2009/10/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2009/10/image-thumb.png" width="291" height="206" /></a>&#160;</p>
<p>When you hit the save button it executes the following code:</p>
<p><font size="1" face="Courier New">try     <br />{      <br />&#160; </font><font size="1"><font face="Courier New"><em>this.Validate();         <br /></em>&#160; this.rulesBindingSource.EndEdit();        <br />&#160; this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules); </font></font></p>
<p><font size="1" face="Courier New">&#160; MessageBox.Show(&quot;Update successful!&quot;); </font></p>
<p><font size="1" face="Courier New">}</font></p>
<p><font size="1" face="Courier New">catch (System.Exception ex)     <br />{      <br />&#160; MessageBox.Show(&quot;Update failed:\n&quot; + ex.Message + &quot;\n&quot; + ex.StackTrace ); </font></p>
<p><font size="1" face="Courier New">}</font></p>
<p><font face="Trebuchet MS">I placed a breakpoint on: <em>this.Validate();</em> line.&#160; When I ran the program&#160; the program failed on: <em>this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules);.&#160; </em>Below is a print screen of the message:</font></p>
<p>&#160;</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2009/10/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2009/10/image-thumb1.png" width="303" height="66" /></a>&#160;</p>
<p>The issue is with the TableAdapter.&#160; There was no UpdateCommand (which is mentioned in the error message) or DeleteCommand for the TableAdapter:</p>
<p>&#160;<a href="http://troyscott.ca/wp-content/uploads/2009/10/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2009/10/image-thumb2.png" width="302" height="155" /></a> </p>
<p>Create a new UpdateCommand by click (new) in the dropdown box.&#160; You can use the query designer to create the update statement for the CommandText property:</p>
<p><a href="http://troyscott.ca/wp-content/uploads/2009/10/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://troyscott.ca/wp-content/uploads/2009/10/image-thumb3.png" width="244" height="220" /></a> </p>
<p>Once the the CommandText property was set for the UpdateCommand the program worked. Below is a link to the issue found on msdn forums:</p>
<p><a title="http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6d4de721-7571-49ca-a1fc-8689ec19a94e/" href="http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6d4de721-7571-49ca-a1fc-8689ec19a94e/">http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6d4de721-7571-49ca-a1fc-8689ec19a94e/</a></p>
<p>Troy</p>
]]></content:encoded>
			<wfw:commentRss>http://troyscott.ca/2009/10/29/update-requires-a-valid-updatecommand-when-passed-datarow-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

