<?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>Code Retard &#187; C#</title>
	<atom:link href="http://www.coderetard.com/category/c-sharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coderetard.com</link>
	<description>Anything Geeky Goes!</description>
	<lastBuildDate>Fri, 20 Nov 2009 13:30:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SharePoint: Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info</title>
		<link>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/</link>
		<comments>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:00:14 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c# microsoft]]></category>
		<category><![CDATA[Cannot connect to SQL Server. pssql1.ext.jpl.net\PartnerSpace not found. Additional error information from SQL Server is included below.]]></category>
		<category><![CDATA[Command line error.]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Multi Forest Configuration and Additional Info]]></category>
		<category><![CDATA[people picker]]></category>
		<category><![CDATA[peoplepicker]]></category>
		<category><![CDATA[SharePoint: Deep Diving with Cross Forest]]></category>
		<category><![CDATA[Verify]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=3519</guid>
		<description><![CDATA[
		
		
		
		Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info
From Joel Oleson&#8217;s Blog URL: http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx:

Background
The people picker works in cross domain or cross forest environment. It works in both-way trust and one-way trust environment.
Out of the box, if the admin does not do any configuration, the people picker will issue queries to all two-way [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint%3A+Deep+Diving+with+Cross+Forest%2C+Multi+Forest+Configuration+and+Additional+Info";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Deep Diving with Cross Forest, Multi Forest Configuration and Additional InfoFrom Joel Oleson&#8217;s Blog URL: http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx:BackgroundThe people picker works...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info</p>
<p>From Joel Oleson&#8217;s Blog URL: <a href="http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx">http://blogs.msdn.com/joelo/archive/2007/03/08/cross-forest-multi-forest-configuration-additional-info.aspx</a>:<br />
<code><br />
Background<br />
The people picker works in cross domain or cross forest environment. It works in both-way trust and one-way trust environment.<br />
Out of the box, if the admin does not do any configuration, the people picker will issue queries to all two-way trusted domains and two-way trusted forests to search people &#038; groups.<br />
The people picker uses the application pool account to search the target domains and forests. If the application pool account does not have permission to the target domains or forests, or the admin want to use different account to search the target domains or forests, the admin could should use<br />
How to Configure<br />
Don’t forget to run stsadm.exe –o setapppassword –password <somekey> on all machines in the farm where SharePoint is installed</p>
<p>1.     Run on every WFE.<br />
stsadm.exe -o setapppassword -password </somekey><somekey></p>
<p>2.     Run on one WFE<br />
stsadm.exe -o setproperty -url ...</somekey></code></p>
<p><strong>What we have found:</strong></p>
<p><span id="more-3519"></span><br />
Example of command:</p>
<p>stsadm.exe -o setproperty -url &#8220;http://MYSHAREPOINTSITE:21212&#8243; -pn &#8220;peoplepicker-searchadforests&#8221; -pv &#8220;domain:mydomain.something.com,USERNAME,PASSWORD&#8221;</p>
<p>1.  http://MYSHAREPOINTSITE:21212 = Your sharepoint site URL</p>
<p>2.  mydomain.something.com = your domain, you can also use forest:BLAHBLAH</p>
<p>3.  USERNAME = your username you want to use to connect to the domain/forest</p>
<p>4.  PASSWORD = Password for the username you want to use to connect to the domain/forest</p>
<p>Errors you May Encounter:</p>
<p>Error 1:</p>
<p>Command line error.<br />
Usage:<br />
stsadm.exe -o <operation> [
<parameters>]</p>
<p>
Solution:<br />
Make sure you use quotes around peoplepicker-searchforests&#8230;. in the example text we use quotes around everything.</p>
<p>Example = -pn &#8220;peoplepicker-searchadforests&#8221; </p>
<p>Error 2:</p>
<p>The Web application at http://MYSHAREPOINTSITE:21212 could not be found. Verify<br />
 that you have typed the URL correctly. If the URL should be serving existing co<br />
ntent, the system administrator may need to add a new request URL mapping to the<br />
 intended application.</p>
<p>Solution:<br />
1.  Try to login as a master account then run the command again (recommended)</p>
<p>2.  If the above solution fails, you may need to extend the web app, then run the setproperty command on the new web app.</p>
<p>Error:</p>
<p>Cannot connect to SQL Server. SQLSERVERNAME not found. Additional error information from SQL Server is included below.<br />
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.</p>
<p>Solution:</p>
<p>Make sure you are RDP&#8217;ed in with an account that has windows access to SQL Server</parameters></operation></p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint: Deep Diving with Cross Forest, Multi Forest Configuration and Additional Info" url="http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;bodytext=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;notes=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;submitHeadline=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;submitSummary=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;h=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;t=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F22%2Fsharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info%2F&amp;title=SharePoint%3A%20Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info&amp;annotation=Deep%20Diving%20with%20Cross%20Forest%2C%20Multi%20Forest%20Configuration%20and%20Additional%20Info%0D%0A%0D%0AFrom%20Joel%20Oleson%27s%20Blog%20URL%3A%20http%3A%2F%2Fblogs.msdn.com%2Fjoelo%2Farchive%2F2007%2F03%2F08%2Fcross-forest-multi-forest-configuration-additional-info.aspx%3A%0D%0A%0D%0ABackground%0D%0AThe%20people%20picke" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/22/sharepoint-deep-diving-with-cross-forest-multi-forest-configuration-and-additional-info/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate a .lib from a DLL with Visual Studio</title>
		<link>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/</link>
		<comments>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 15:43:00 +0000</pubDate>
		<dc:creator>adm_snackbar</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[generate lib from dll]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/</guid>
		<description><![CDATA[
		
		
		
		
Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without having to recompile and rebuild code. However, linking code in Visual [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/how-to-automate-builds-with-visual-studio/' rel='bookmark' title='Permanent Link: How to Automate Builds with Visual Studio'>How to Automate Builds with Visual Studio</a></li><li><a href='http://www.coderetard.com/2008/11/30/microsoft-sues-to-defend-visual-studio-users/' rel='bookmark' title='Permanent Link: Microsoft Sues to Defend Visual Studio Users'>Microsoft Sues to Defend Visual Studio Users</a></li><li><a href='http://www.coderetard.com/2008/10/08/svn-error-while-loading-shared-libraries-libcom_errso3/' rel='bookmark' title='Permanent Link: SVN Error While Loading Shared Libraries: libcom_err.so.3'>SVN Error While Loading Shared Libraries: libcom_err.so.3</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Generate+a+.lib+from+a+DLL+with+Visual+Studio";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img src="http://www.coderetard.com/wp-content/uploads/2009/01/vs_teamsystem.jpg" alt="visual studio team system" title="visual studio team system" width="500" height="375" class="size-full wp-image-3512" /></p>
<p>Oftentimes programmers have to deal with external third party DLLs that their software rely on to function. This is both smart and useful because as long as the DLL interface remains the same, externally linked DLLs can be easily swapped in and out without having to recompile and rebuild code. However, linking code in Visual Studio with an external library requires that a .lib file exist &#8211; the DLL is actually not sufficient for this task. Fortunately, there is a way to generate a .lib from a DLL with Visual Studio. Creating the .lib file is a bit like reverse engineering the DLL&#8217;s symbols.</p>
<p> <span id="more-3509"></span>
</p>
<ol>
<li>Regardless of your Visual Studio version, whether it&#8217;s for 2003, 2005, or 2008 .NET, open up the Visual Studio Tools command promopt (something like Start -&gt; Program Files -&gt; Microsoft Visual Studio -&gt; Visual Studio Tools -&gt; Visual Studio Command Prompt). </li>
<li>If you have a .def file for your DLL, you can skip this step. Otherwise if your DLL did not ship with a .def file, you have a bit of work ahead of you. You cannot generate a .lib without a .def file first, sorry. To generate a .def file from a DLL, execute the <strong>dumpbin</strong> command to extract the function names from your DLL. In our example, we will be building from sqlite3.dll.       <br /><code>dumpbin /exports C:\path\to\sqlite3.dll</code>The output appears below:<img title="vs_dumpbin" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="467" alt="vs_dumpbin" src="http://www.coderetard.com/wp-content/uploads/2009/01/vs-dumpbin.jpg" width="499" border="0" />       <br />The function names boxed in red are what you need to care about. Copy just the function name text into a new file with .def extension. Start the new file with &quot;EXPORTS” without the quotes and then have each function on its own line like this:       <br /><code>EXPORTS        <br />sqlite3_aggregate_context         <br />sqlite3_aggregate_count         <br />sqlite3_auto_extension         <br />sqlite3_bind_blob         <br />sqlite3_bind_double         <br />sqlite3_bind_int         <br />sqlite3_bind_int64         <br />...         <br /></code></li>
<li>With your new definition file in tow, in the command prompt you can execute the <strong>lib</strong> command to finally generate the .lib file:<code>lib /def:C:\path\to\sqlite3.def /out:C:\path\to\sqlite3.lib /machine:x86</code>       <br />This generates the .lib file you can use to link with in your project file. Note that the /machine argument can take any number of machine configuration so be sure to choose the correct one. To get a list of all machine types, simply type “lib” by itself. Here is the usage below for your edification:       <br /><code>usage: LIB [options] [files]
<p>options:         </p>
<p>/DEF[:filename]         <br />/EXPORT:symbol         <br />/EXTRACT:membername         <br />/INCLUDE:symbol         <br />/LIBPATH:dir         <br />/LIST[:filename]         </p>
<p>/MACHINE:{AM33|ARM|EBC|IA64|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|         <br />SH3|SH3DSP|SH4|SH5|THUMB|X86}         <br />/NAME:filename         <br />/NODEFAULTLIB[:library]         <br />/NOLOGO         <br />/OUT:filename         <br />/REMOVE:membername         <br />/SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|         <br />EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|         <br />WINDOWSCE}[,#[.##]]         <br />/VERBOSE</code> </li>
</ol>
<p>And if you came looking for sqlite3.lib we just saved you a lot of time.</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Generate a .lib from a DLL with Visual Studio" url="http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;bodytext=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;notes=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;submitHeadline=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;submitSummary=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;h=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;t=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F21%2Fgenerate-a-lib-from-a-dll-with-visual-studio%2F&amp;title=Generate%20a%20.lib%20from%20a%20DLL%20with%20Visual%20Studio&amp;annotation=%0D%0AOftentimes%20programmers%20have%20to%20deal%20with%20external%20third%20party%20DLLs%20that%20their%20software%20rely%20on%20to%20function.%20This%20is%20both%20smart%20and%20useful%20because%20as%20long%20as%20the%20DLL%20interface%20remains%20the%20same%2C%20externally%20linked%20DLLs%20can%20be%20easily%20swapped%20in%20and%20out" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/how-to-automate-builds-with-visual-studio/' rel='bookmark' title='Permanent Link: How to Automate Builds with Visual Studio'>How to Automate Builds with Visual Studio</a></li><li><a href='http://www.coderetard.com/2008/11/30/microsoft-sues-to-defend-visual-studio-users/' rel='bookmark' title='Permanent Link: Microsoft Sues to Defend Visual Studio Users'>Microsoft Sues to Defend Visual Studio Users</a></li><li><a href='http://www.coderetard.com/2008/10/08/svn-error-while-loading-shared-libraries-libcom_errso3/' rel='bookmark' title='Permanent Link: SVN Error While Loading Shared Libraries: libcom_err.so.3'>SVN Error While Loading Shared Libraries: libcom_err.so.3</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</title>
		<link>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/</link>
		<comments>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 16:29:48 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[asmx]]></category>
		<category><![CDATA[Attempted to perform an unauthorized operation]]></category>
		<category><![CDATA[sharepoiint search]]></category>
		<category><![CDATA[sharepoint search]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[_vti_bin/search.asmx]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=3348</guid>
		<description><![CDATA[
		
		
		
		Server was unable to process request. —> Attempted to perform an unauthorized operation


queryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);

or you may want to try different passing

queryService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

or

NetworkCredential networkCredential = CredentialCache.DefaultCredentials.GetCredential(new Uri(queryService.Url), “NTLM”);
or
queryService.Credentials = networkCredential;

 queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
queryService.PreAuthenticate = true;

What we found the error to be was:
1.  Check to make sure account you are logging in with [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li><li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint+Search+Web+Service+Error%3A+Attempted+to+perform+an+unauthorized+operation";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Server was unable to process request. —> Attempted to perform an unauthorized operationqueryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);or you may want to try different passingqueryService.Credentials...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Server was unable to process request. —> Attempted to perform an unauthorized operation<br />
<br />
<code><br />
queryService.Credentials = new System.Net.NetworkCredential(“username”,“password”,“domain”);<br />
<br />
or you may want to try different passing<br />
<br />
queryService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;<br />
<br />
or<br />
<br />
NetworkCredential networkCredential = CredentialCache.DefaultCredentials.GetCredential(new Uri(queryService.Url), “NTLM”);<br />
<br />or</p>
<p>queryService.Credentials = networkCredential;<br />
<br />
 queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;<br />
queryService.PreAuthenticate = true;<br />
</code></p>
<p>What we found the error to be was:<br />
1.  Check to make sure account you are logging in with has authority to do so.</p>
<p>2.  Make sure that you are able to connect to the sites search service (IE, make sure its working properly)  Try to connect to other search services to debug issue &#8211; Most times default credentials so not work and you will need to login.<br />
<br />
You can try to use the Search Service tool here:<br />
<a href="http://www.mosssearch.com/searchwebservice.html">http://www.mosssearch.com/searchwebservice.html</a><br />
But that only allows you to login with default credentials and may fail some of the time.</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint Search Web Service Error: Attempted to perform an unauthorized operation" url="http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation%20-%20http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;bodytext=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;notes=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;submitHeadline=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;submitSummary=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;h=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;t=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2009%2F01%2F09%2Fsharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation%2F&amp;title=SharePoint%20Search%20Web%20Service%20Error%3A%20Attempted%20to%20perform%20an%20unauthorized%20operation&amp;annotation=Server%20was%20unable%20to%20process%20request.%20%E2%80%94%3E%20Attempted%20to%20perform%20an%20unauthorized%20operation%0D%0A%0D%0A%0D%0AqueryService.Credentials%20%3D%20new%20System.Net.NetworkCredential%28%E2%80%9Cusername%E2%80%9D%2C%E2%80%9Cpassword%E2%80%9D%2C%E2%80%9Cdomain%E2%80%9D%29%3B%0D%0A%0D%0Aor%20you%20may%20want%20to%20try%20different%20passing%0D%0A%0D%0Aque" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li><li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint C# &#8211; SecurityException: WebPermission Request Error</title>
		<link>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/</link>
		<comments>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 20:47:44 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=957</guid>
		<description><![CDATA[
		
		
		
		Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level in the configuration file. 
Exception Details: System.Security.SecurityException: Request for the permission of type &#8216;System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242; failed.
Source Error: 
An [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li><li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint+C%23+%26%238211%3B+SecurityException%3A+WebPermission+Request+Error";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Security ExceptionDescription: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><blockquote><p>Security Exception<br />
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&#8217;s trust level in the configuration file. </p>
<p>Exception Details: System.Security.SecurityException: Request for the permission of type &#8216;System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#8242; failed.</p>
<p>Source Error: </p>
<p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
</p></blockquote>
<p>If you care getting the error above in SharePoint, there is a simple work around to get your code to work.</p>
<p>1.  Open the wss_minimaltrust.config located: &#8220;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG&#8221;</p>
<p>2.  Under the XML section &lt;namedpermissionsets&gt; and under the last &lt;permissionset&gt; add</p>
<p><code><br />
&lt;ipermission&gt;<br />
class="WebPermission"<br />
version="1"<br />
Unrestricted="true"&gt;<br />
&lt;/ipermission&gt;</code></p>
<p>3.  Save the file and you are good to go!</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint C# - SecurityException: WebPermission Request Error" url="http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;bodytext=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;notes=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;submitHeadline=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;submitSummary=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;h=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;t=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F16%2Fsharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed%2F&amp;title=SharePoint%20C%23%20-%20SecurityException%3A%20WebPermission%20Request%20Error&amp;annotation=%0D%0ASecurity%20Exception%20%0D%0ADescription%3A%20The%20application%20attempted%20to%20perform%20an%20operation%20not%20allowed%20by%20the%20security%20policy.%20%20To%20grant%20this%20application%20the%20required%20permission%20please%20contact%20your%20system%20administrator%20or%20change%20the%20application%27s%20trust%20le" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li><li><a href='http://www.coderetard.com/2009/01/09/sharepoint-search-web-service-attempted-to-perform-an-unauthorized-operation/' rel='bookmark' title='Permanent Link: SharePoint Search Web Service Error: Attempted to perform an unauthorized operation'>SharePoint Search Web Service Error: Attempted to perform an unauthorized operation</a></li><li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>c# Generate a Random Number</title>
		<link>http://www.coderetard.com/2008/06/10/c-generate-a-random-number/</link>
		<comments>http://www.coderetard.com/2008/06/10/c-generate-a-random-number/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 23:53:55 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c# Generate a Random Number. code]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[random number]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=923</guid>
		<description><![CDATA[
		
		
		
		The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max); 
}
How to use it?
Copy the above code in your class where you want to use [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/' rel='bookmark' title='Permanent Link: Generate a .lib from a DLL with Visual Studio'>Generate a .lib from a DLL with Visual Studio</a></li><li><a href='http://www.coderetard.com/2008/03/10/random-value-generator-with-string-arrays-in-c/' rel='bookmark' title='Permanent Link: Random Value Generator with String Arrays in C#'>Random Value Generator with String Arrays in C#</a></li><li><a href='http://www.coderetard.com/2008/03/11/the-programmer-code-off/' rel='bookmark' title='Permanent Link: The Programmer Code Off!'>The Programmer Code Off!</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/06/10/c-generate-a-random-number/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "c%23+Generate+a+Random+Number";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.private int RandomNumber(int min, int max){Random random = new Random();return random.Next(min, max);...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.</p>
<p><code>private int RandomNumber(int min, int max)<br />
{<br />
Random random = new Random();<br />
return random.Next(min, max); <br />
}</code></p>
<p>How to use it?</p>
<p>Copy the above code in your class where you want to use it and call like this:</p>
<p><code>int returnValue = RandomNumber(5, 20);</code></p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="c# Generate a Random Number" url="http://www.coderetard.com/2008/06/10/c-generate-a-random-number/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=c%23%20Generate%20a%20Random%20Number%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;bodytext=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;notes=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=c%23%20Generate%20a%20Random%20Number&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;submitHeadline=c%23%20Generate%20a%20Random%20Number&amp;submitSummary=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random.&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;h=c%23%20Generate%20a%20Random%20Number" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;t=c%23%20Generate%20a%20Random%20Number" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F06%2F10%2Fc-generate-a-random-number%2F&amp;title=c%23%20Generate%20a%20Random%20Number&amp;annotation=The%20following%20code%20snippet%20shows%20how%20to%20generate%20a%20random%20number%20between%20a%20range%20in%20C%23%2C%20where%20min%20and%20max%20are%20minimum%20and%20maximum%20range%20of%20the%20new%20number.%0D%0A%0D%0Aprivate%20int%20RandomNumber%28int%20min%2C%20int%20max%29%0D%0A%7B%0D%0ARandom%20random%20%3D%20new%20Random%28%29%3B%0D%0Areturn%20random." title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2009/01/21/generate-a-lib-from-a-dll-with-visual-studio/' rel='bookmark' title='Permanent Link: Generate a .lib from a DLL with Visual Studio'>Generate a .lib from a DLL with Visual Studio</a></li><li><a href='http://www.coderetard.com/2008/03/10/random-value-generator-with-string-arrays-in-c/' rel='bookmark' title='Permanent Link: Random Value Generator with String Arrays in C#'>Random Value Generator with String Arrays in C#</a></li><li><a href='http://www.coderetard.com/2008/03/11/the-programmer-code-off/' rel='bookmark' title='Permanent Link: The Programmer Code Off!'>The Programmer Code Off!</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/06/10/c-generate-a-random-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Six recommendations for starting a startup with ASP.NET</title>
		<link>http://www.coderetard.com/2008/04/23/six-recommendations-for-starting-a-startup-with-aspnet/</link>
		<comments>http://www.coderetard.com/2008/04/23/six-recommendations-for-starting-a-startup-with-aspnet/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 16:16:42 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=589</guid>
		<description><![CDATA[
		
		
		
		

1. Do use ASP.NET MVC (or at least learn the web like everybody else)
Don&#8217;t deal with ViewState, don&#8217;t deal with leaky abstractions of the web in a way that confounds you. You&#8217;ll thank yourself for writing cleaner code that you can test, and for mastering the deceptively simple art of web development. &#8220;It&#8217;s all just [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/aspnet-version-greyed-out-on-iis-version-60/' rel='bookmark' title='Permanent Link: ASP.NET version greyed out on IIS version 6.0'>ASP.NET version greyed out on IIS version 6.0</a></li><li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/04/23/six-recommendations-for-starting-a-startup-with-aspnet/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Six+recommendations+for+starting+a+startup+with+ASP.NET";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "1. Do use ASP.NET MVC (or at least learn the web like everybody else)Don&#8217;t deal with ViewState, don&#8217;t deal with leaky abstractions of the web in a way that confounds you. You&#8217;ll thank yourself for writing cleaner code that you can test,...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img src="http://www.coderetard.com/wp-content/uploads/2008/04/aspnet.jpg" alt="ASP.net" title="aspnet" width="291" height="90" class="alignnone size-full wp-image-603" />
<link rel="image_src" href="http://www.coderetard.com/wp-content/uploads/2008/04/aspnet.jpg" />
<p>1. Do use ASP.NET MVC (or at least learn the web like everybody else)</p>
<p>Don&#8217;t deal with ViewState, don&#8217;t deal with leaky abstractions of the web in a way that confounds you. You&#8217;ll thank yourself for writing cleaner code that you can test, and for mastering the deceptively simple art of web development. &#8220;It&#8217;s all just markup&#8221; is a mantra that will keep you on track when you feel overwhelmed with the new model, but it&#8217;s a new model you want to learn. If you don&#8217;t want to learn ASP.NET MVC, do yourself a favor and disable ViewState at the page level, and do what you can to avoid using it, whether that&#8217;s baking your own MVC-like &#8220;markup + business objects&#8221; design, or embracing the client-centric development model with JavaScript against ASP.NET controls that don&#8217;t require ViewState. Make friends with the Repeater.</p>
<p><span id="more-589"></span><br />
2. Don&#8217;t use large third-party control libraries (they don&#8217;t buy you the time you think they do)</p>
<p>I decided to buy a very popular (and expensive) third party control library. My instinct was that, as a single developer working on a web startup by moonlight, I could leverage enterprise-class support and a robust API to make short work of some of the more complex UI tasks. I ended up spending more time trying to ramp up with the documentation and hunting down bugs or my own misuse of the framework than I would have writing my own controls. It may be tempting to believe the third party solution will solve all of your problems, but the key to a startup is to release early and get feedback as soon as possible. Stick with simple controls and markup that you can understand and stay clear of off-the-shelf products if your time is tight (and it is). Remember that many hands built that product, and attempting to master its nuances is no different, to me, than stealing code and trying to reverse-engineer it; both cut out your momentum and take you away from your own ideas. Nobody needs extra dependence. If you have to use a framework, stick with a free one like ExtJs, and use the money on graphic design instead.</p>
<p>3. Do use jQuery (it&#8217;s small and does it all)</p>
<p>You simply can&#8217;t afford to send 150kb to a user&#8217;s browser to buy you basic Javascript UI. This little monster costs you 15kb and it can do everything you can imagine. jQuery in combination with (optimized and combined) ASP.NET AJAX web service proxies is all you need to make calls over the wire and do amazing things on the browser. Any other solution is unwieldy, bloated, and takes too much time, period.</p>
<p>4. Don&#8217;t use the UpdatePanel (tough love, but you need it)</p>
<p>Speaking of unwieldy, don&#8217;t let this siren succor you into a false sense of ability. The UpdatePanel might be useful for the very isolated case of posting back a large form that needed to be submitted in the first place, but under no circumstances does sending most of a web page to the server and then updating small parts of it on the client constitute a practical or desirable approach to building AJAX sites that aren&#8217;t on a corporate intranet with a giant pipe underneath. If you&#8217;re a startup you&#8217;re likely building a public-facing application that&#8217;s intended to be SaaS. If you want that service to be performant, you need to make small client changes either entirely on the client itself, or submitting just what you intend to change through a web service call. Take the time and learn how to do &#8220;real&#8221; ASP.NET AJAX; that is, build static page methods, WCF services, or script methods, and call those on the client-side via JavaScript. ASP.NET AJAX will take care of the JSON serialization for you so you&#8217;re free to return custom objects in your service methods. Anything else is asking for trouble.</p>
<p>5. Do use a graphic designer (A startup has no excuse for poor design)</p>
<p>A &#8220;programmer&#8217;s aesthetic&#8221; is often cited as a suitable excuse for a shoddy design, and if you study the well-established startups that exist in the wild, many of them leave a lot to be desired in this department. Don&#8217;t confuse successful-and-ugly with a real decision made somewhere along the line to skimp on design. Those sites are successful for a variety of unrelated reasons, including timing, and if you are similar in any way to one of these existing ventures, you&#8217;re going to need to differentiate in more ways than features. Do yourself a favor and at least invest a little money on your logo.</p>
<p>6. Do use an automated entity persistence solution (because you have better things to do)</p>
<p>John S. pointed out that I had missed one of the fundamental pain points when building a web application: entity persistence, or &#8220;object-relational mapping&#8221;. This is the concept of leaning on a reliable, automatic way of moving business objects (tags, people, groups, photos, forums, posts, et al.) to the database and back without having to think about, or write, reams of code to handle it. I ended up using LINQ to SQL for my startup because I had a simple data model (many social networking applications do) that didn&#8217;t need multiple table inheritance, or non-PK relationships; otherwise I would recommend an alternative. A lot of agile developers recommend SubSonic (and frankly it looks so darn cool), and you could try NHibernate as well, and there are many other options; the emphasis here is to use one you like, but do use one. </p>
<p>(Source: <a href="http://www.dimebrain.com/2008/04/five-recommenda.html">dimebrain</a>)</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Six recommendations for starting a startup with ASP.NET" url="http://www.coderetard.com/2008/04/23/six-recommendations-for-starting-a-startup-with-aspnet/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET&amp;bodytext=%0D%0A%0D%0A1.%20Do%20use%20ASP.NET%20MVC%20%28or%20at%20least%20learn%20the%20web%20like%20everybody%20else%29%0D%0A%0D%0ADon%27t%20deal%20with%20ViewState%2C%20don%27t%20deal%20with%20leaky%20abstractions%20of%20the%20web%20in%20a%20way%20that%20confounds%20you.%20You%27ll%20thank%20yourself%20for%20writing%20cleaner%20code%20that%20you%20can%20test%2C%20and%20f" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET&amp;notes=%0D%0A%0D%0A1.%20Do%20use%20ASP.NET%20MVC%20%28or%20at%20least%20learn%20the%20web%20like%20everybody%20else%29%0D%0A%0D%0ADon%27t%20deal%20with%20ViewState%2C%20don%27t%20deal%20with%20leaky%20abstractions%20of%20the%20web%20in%20a%20way%20that%20confounds%20you.%20You%27ll%20thank%20yourself%20for%20writing%20cleaner%20code%20that%20you%20can%20test%2C%20and%20f" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;submitHeadline=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET&amp;submitSummary=%0D%0A%0D%0A1.%20Do%20use%20ASP.NET%20MVC%20%28or%20at%20least%20learn%20the%20web%20like%20everybody%20else%29%0D%0A%0D%0ADon%27t%20deal%20with%20ViewState%2C%20don%27t%20deal%20with%20leaky%20abstractions%20of%20the%20web%20in%20a%20way%20that%20confounds%20you.%20You%27ll%20thank%20yourself%20for%20writing%20cleaner%20code%20that%20you%20can%20test%2C%20and%20f&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;h=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;t=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F23%2Fsix-recommendations-for-starting-a-startup-with-aspnet%2F&amp;title=Six%20recommendations%20for%20starting%20a%20startup%20with%20ASP.NET&amp;annotation=%0D%0A%0D%0A1.%20Do%20use%20ASP.NET%20MVC%20%28or%20at%20least%20learn%20the%20web%20like%20everybody%20else%29%0D%0A%0D%0ADon%27t%20deal%20with%20ViewState%2C%20don%27t%20deal%20with%20leaky%20abstractions%20of%20the%20web%20in%20a%20way%20that%20confounds%20you.%20You%27ll%20thank%20yourself%20for%20writing%20cleaner%20code%20that%20you%20can%20test%2C%20and%20f" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/04/07/aspnet-version-greyed-out-on-iis-version-60/' rel='bookmark' title='Permanent Link: ASP.NET version greyed out on IIS version 6.0'>ASP.NET version greyed out on IIS version 6.0</a></li><li><a href='http://www.coderetard.com/2008/10/13/how-to-enable-net-send-messenger-service-on-windows-xp/' rel='bookmark' title='Permanent Link: How to Enable NET SEND Messenger Service on Windows XP'>How to Enable NET SEND Messenger Service on Windows XP</a></li><li><a href='http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/' rel='bookmark' title='Permanent Link: SharePoint Search Failing: Application Server job failed for service instance'>SharePoint Search Failing: Application Server job failed for service instance</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/04/23/six-recommendations-for-starting-a-startup-with-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the using-statement</title>
		<link>http://www.coderetard.com/2008/04/21/using-the-using-statement/</link>
		<comments>http://www.coderetard.com/2008/04/21/using-the-using-statement/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 17:42:40 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[using]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/?p=571</guid>
		<description><![CDATA[
		
		
		
		â€œUsing statement?â€, you may ask. â€œWhat is so interesting about that? I use it every day importing tons of namespaces!â€
Well, i mean the other using statement; that one that results in a nice try..finally in IL, without having to write lots of code.
Well lets say you want to access a file, a database, or whatever [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/18/how-to-convert-txt-docs-to-pdf-in-aspose/' rel='bookmark' title='Permanent Link: How to Convert Txt Docs to PDF in Aspose c#'>How to Convert Txt Docs to PDF in Aspose c#</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/04/21/using-the-using-statement/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Using+the+using-statement";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "â€œUsing statement?â€, you may ask. â€œWhat is so interesting about that? I use it every day importing tons of namespaces!â€Well, i mean the other using statement; that one that results in a nice try..finally in IL, without having to...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>â€œUsing statement?â€, you may ask. â€œWhat is so interesting about that? I use it every day importing tons of namespaces!â€<br />
Well, i mean the other using statement; that one that results in a nice try..finally in IL, without having to write lots of code.</p>
<p>Well lets say you want to access a file, a database, or whatever resource that needs to be closed after usage:</p>
<p><span id="more-571"></span></p>
<blockquote>
<p>StreamReader sr = new StreamReader(@&#8221;c:\mytextfile.txt&#8221;);   <br />
sr.ReadToEnd().Count(); // just doing something   <br />
sr.Close(); // closing a resource explicitly. gooood!  </p>
</p>
</blockquote>
<p>The problem here is: If the file for example is not encoded correctly, or youâ€™re just doing something inbetween opening and closing your reader that might fail, your resource will not be closed until the GC disposes it. This in some cases might mean, until your application is closed.<br />
Putting a try catch arround it helps:</p>
<blockquote>
<p>StreamReader sr = null;   <br />
try  <br />
{   <br />
  sr = new StreamReader(@&#8221;c:\mytextfile.txt&#8221;);   <br />
  sr.ReadToEnd().Count(); // just doing something   <br />
}   <br />
finally  <br />
{   <br />
  if (sr != null) // StreamReader.ctr() could fail&#8230;   <br />
  sr.Close();   <br />
}  </p>
</blockquote>
<p>The using statement does exactly the same. The IL-Code also looks pretty similar, but it is way easier to write.</p>
<blockquote>
<p>using(StreamReader sr = new StreamReader(@&#8221;c:\my.txt&#8221;))   <br />
{   <br />
  sr.ReadToEnd().Count(); // just doing something   <br />
}  </p>
</p>
</blockquote>
<p>The using-statement takes any object implementing IDisposable. In the end or in case of any error, it will safely dispose the used resource. The Dispose()-Method on Streams or any other Reader/Writer in usually does the same thing as Close() does.<br />
You can even nest them if you have to use multiple resource at once:</p>
<blockquote>
<p>using(StreamReader sr1 = new StreamReader(@&#8221;c:\my1.txt&#8221;))   <br />
using (StreamReader sr2 = new StreamReader(@&#8221;c:\my2.txt&#8221;))   <br />
using (StreamWriter sw = new StreamWriter(@&#8221;c:\mynew.txt&#8221;))   <br />
{   <br />
  sw.WriteLine(sr1.ReadToEnd());   <br />
  sw.WriteLine(sr2.ReadToEnd());   <br />
}  </p>
</blockquote>
<p>Almost any resource usage in .Net, for example ADO.Net implements the IDisposable on their classes. The connection will be closed and disposed, the transaction will be rolled back if something fails before commit.</p>
<blockquote>
<p>using (var conn = new SqlConnection(&#8221;&#8230;&#8221;))   <br />
{   <br />
  using (var st = conn.BeginTransaction())     <br />
  {   <br />
    conn.Open();   <br />
    var sc = conn.CreateCommand();   <br />
    sc.CommandText = &#8220;UPDATE &#8230;&#8221;;   <br />
    sc.ExecuteNonQuery();   <br />
    var sc2 = conn.CreateCommand();   <br />
    sc2.CommandText = &#8220;SELECT &#8230;&#8221;;   <br />
    using (var reader = sc2.ExecuteReader())   <br />
    {   <br />
      return reader.GetString(0);   <br />
    }   <br />
    st.Commit();  </p>
<p>  }   <br />
}<br /> 
</p>
</blockquote>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Using the using-statement" url="http://www.coderetard.com/2008/04/21/using-the-using-statement/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Using%20the%20using-statement%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement&amp;bodytext=%C3%A2%E2%82%AC%C5%93Using%20statement%3F%C3%A2%E2%82%AC%C2%9D%2C%20you%20may%20ask.%20%C3%A2%E2%82%AC%C5%93What%20is%20so%20interesting%20about%20that%3F%20I%20use%20it%20every%20day%20importing%20tons%20of%20namespaces%21%C3%A2%E2%82%AC%C2%9D%0D%0AWell%2C%20i%20mean%20the%20other%20using%20statement%3B%20that%20one%20that%20results%20in%20a%20nice%20try..finally%20in%20IL%2C%20without%20having" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement&amp;notes=%C3%A2%E2%82%AC%C5%93Using%20statement%3F%C3%A2%E2%82%AC%C2%9D%2C%20you%20may%20ask.%20%C3%A2%E2%82%AC%C5%93What%20is%20so%20interesting%20about%20that%3F%20I%20use%20it%20every%20day%20importing%20tons%20of%20namespaces%21%C3%A2%E2%82%AC%C2%9D%0D%0AWell%2C%20i%20mean%20the%20other%20using%20statement%3B%20that%20one%20that%20results%20in%20a%20nice%20try..finally%20in%20IL%2C%20without%20having" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Using%20the%20using-statement&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;submitHeadline=Using%20the%20using-statement&amp;submitSummary=%C3%A2%E2%82%AC%C5%93Using%20statement%3F%C3%A2%E2%82%AC%C2%9D%2C%20you%20may%20ask.%20%C3%A2%E2%82%AC%C5%93What%20is%20so%20interesting%20about%20that%3F%20I%20use%20it%20every%20day%20importing%20tons%20of%20namespaces%21%C3%A2%E2%82%AC%C2%9D%0D%0AWell%2C%20i%20mean%20the%20other%20using%20statement%3B%20that%20one%20that%20results%20in%20a%20nice%20try..finally%20in%20IL%2C%20without%20having&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;h=Using%20the%20using-statement" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;t=Using%20the%20using-statement" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F21%2Fusing-the-using-statement%2F&amp;title=Using%20the%20using-statement&amp;annotation=%C3%A2%E2%82%AC%C5%93Using%20statement%3F%C3%A2%E2%82%AC%C2%9D%2C%20you%20may%20ask.%20%C3%A2%E2%82%AC%C5%93What%20is%20so%20interesting%20about%20that%3F%20I%20use%20it%20every%20day%20importing%20tons%20of%20namespaces%21%C3%A2%E2%82%AC%C2%9D%0D%0AWell%2C%20i%20mean%20the%20other%20using%20statement%3B%20that%20one%20that%20results%20in%20a%20nice%20try..finally%20in%20IL%2C%20without%20having" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/18/how-to-convert-txt-docs-to-pdf-in-aspose/' rel='bookmark' title='Permanent Link: How to Convert Txt Docs to PDF in Aspose c#'>How to Convert Txt Docs to PDF in Aspose c#</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/04/21/using-the-using-statement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reading XML into dataset / GridView c# : Read XML From URL</title>
		<link>http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/</link>
		<comments>http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 15:03:55 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[doc]]></category>
		<category><![CDATA[DS]]></category>
		<category><![CDATA[dvi]]></category>
		<category><![CDATA[ea]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[Ping]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/</guid>
		<description><![CDATA[
		
		
		
		
So recently I had to read an xml file and then bind it to a dataset/gridview.  I knew there had to be an easy way.  This is how I ended up doing it:
aspx

asp :GridView ID="gvDocActivity" runat="server" AutoGenerateColumns="false" /


Code behind:

string URLString = "http://YOUR XML FILE";
XmlTextReader xmlTextReader = new XmlTextReader(URLString);
      [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/16/c-vs-objective-c/' rel='bookmark' title='Permanent Link: C# vs Objective C'>C# vs Objective C</a></li><li><a href='http://www.coderetard.com/2008/04/03/how-to-crack-wep-wireless-networks/' rel='bookmark' title='Permanent Link: How to crack WEP wireless networks'>How to crack WEP wireless networks</a></li><li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Reading+XML+into+dataset+%2F+GridView+c%23+%3A+Read+XML+From+URL";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "So recently I had to read an xml file and then bind it to a dataset/gridview.  I knew there had to be an easy way.  This is how I ended up doing it:aspxasp :GridView ID="gvDocActivity" runat="server" AutoGenerateColumns="false" /Code behind:string URLString...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img src='http://www.coderetard.com/wp-content/uploads/2008/04/camping-xml-situps1.png' alt='camping-xml-situps1.png' title="Reading XML into dataset / GridView c# : Read XML From URL" /></p>
<p>So recently I had to read an xml file and then bind it to a dataset/gridview.  I knew there had to be an easy way.  This is how I ended up doing it:</p>
<p>aspx<br />
<code><br />
asp :GridView ID="gvDocActivity" runat="server" AutoGenerateColumns="false" /<br />
</code><br />
<span id="more-415"></span></p>
<p>Code behind:<br />
<code><br />
string URLString = "http://YOUR XML FILE";</p>
<p>XmlTextReader xmlTextReader = new XmlTextReader(URLString);<br />
            XmlDataDocument xdoc1 = new XmlDataDocument();<br />
            xdoc1.DataSet.ReadXml(xmlTextReader, XmlReadMode.InferSchema);</p>
<p>            DataSet ds = xdoc1.DataSet;</p>
<p>            if (ds.Tables.Count > 0)<br />
            {<br />
                gvDocActivity.DataSource = ds;<br />
                gvDocActivity.DataBind();<br />
             }<br />
</code></p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Reading XML into dataset / GridView c# : Read XML From URL" url="http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL&amp;bodytext=%0D%0A%0D%0A%0D%0A%0D%0ASo%20recently%20I%20had%20to%20read%20an%20xml%20file%20and%20then%20bind%20it%20to%20a%20dataset%2Fgridview.%20%20I%20knew%20there%20had%20to%20be%20an%20easy%20way.%20%20This%20is%20how%20I%20ended%20up%20doing%20it%3A%0D%0A%0D%0Aaspx%0D%0A%0D%0Aasp%20%3AGridView%20ID%3D%22gvDocActivity%22%20runat%3D%22server%22%20AutoGenerateColumns%3D%22false%22%20%2F%0D%0A%0D%0A%0D" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL&amp;notes=%0D%0A%0D%0A%0D%0A%0D%0ASo%20recently%20I%20had%20to%20read%20an%20xml%20file%20and%20then%20bind%20it%20to%20a%20dataset%2Fgridview.%20%20I%20knew%20there%20had%20to%20be%20an%20easy%20way.%20%20This%20is%20how%20I%20ended%20up%20doing%20it%3A%0D%0A%0D%0Aaspx%0D%0A%0D%0Aasp%20%3AGridView%20ID%3D%22gvDocActivity%22%20runat%3D%22server%22%20AutoGenerateColumns%3D%22false%22%20%2F%0D%0A%0D%0A%0D" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;submitHeadline=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL&amp;submitSummary=%0D%0A%0D%0A%0D%0A%0D%0ASo%20recently%20I%20had%20to%20read%20an%20xml%20file%20and%20then%20bind%20it%20to%20a%20dataset%2Fgridview.%20%20I%20knew%20there%20had%20to%20be%20an%20easy%20way.%20%20This%20is%20how%20I%20ended%20up%20doing%20it%3A%0D%0A%0D%0Aaspx%0D%0A%0D%0Aasp%20%3AGridView%20ID%3D%22gvDocActivity%22%20runat%3D%22server%22%20AutoGenerateColumns%3D%22false%22%20%2F%0D%0A%0D%0A%0D&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;h=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;t=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F04%2F07%2Freading-xml-into-dataset-gridview-c%2F&amp;title=Reading%20XML%20into%20dataset%20%2F%20GridView%20c%23%20%3A%20Read%20XML%20From%20URL&amp;annotation=%0D%0A%0D%0A%0D%0A%0D%0ASo%20recently%20I%20had%20to%20read%20an%20xml%20file%20and%20then%20bind%20it%20to%20a%20dataset%2Fgridview.%20%20I%20knew%20there%20had%20to%20be%20an%20easy%20way.%20%20This%20is%20how%20I%20ended%20up%20doing%20it%3A%0D%0A%0D%0Aaspx%0D%0A%0D%0Aasp%20%3AGridView%20ID%3D%22gvDocActivity%22%20runat%3D%22server%22%20AutoGenerateColumns%3D%22false%22%20%2F%0D%0A%0D%0A%0D" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/16/c-vs-objective-c/' rel='bookmark' title='Permanent Link: C# vs Objective C'>C# vs Objective C</a></li><li><a href='http://www.coderetard.com/2008/04/03/how-to-crack-wep-wireless-networks/' rel='bookmark' title='Permanent Link: How to crack WEP wireless networks'>How to crack WEP wireless networks</a></li><li><a href='http://www.coderetard.com/2009/02/11/sharepoint-template-error-the-template-you-have-chosen-is-invalid-or-cannot-be-found/' rel='bookmark' title='Permanent Link: SharePoint Template Error: The template you have chosen is invalid or cannot be found.'>SharePoint Template Error: The template you have chosen is invalid or cannot be found.</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/04/07/reading-xml-into-dataset-gridview-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SharePoint Search Failing: Application Server job failed for service instance</title>
		<link>http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/</link>
		<comments>http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 18:36:25 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[case]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[DS]]></category>
		<category><![CDATA[ea]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[exo]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[ink]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[nds]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[sharepoint search]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[stsadm]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[tsa]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/</guid>
		<description><![CDATA[
		
		
		
		Was getting this error:
Application Server job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (34c9a339-ef4a-454b-a288-812fd2fd1270).

Reason: Index was outside the bounds of the array.
Techinal Support Details:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.SynchronizeDefaultContentSource(IDictionary applications)
   at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize()
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Solution:
stsadm -o osearch [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/29/office-sharepoint-server-2007-training/' rel='bookmark' title='Permanent Link: Office SharePoint Server 2007 Training'>Office SharePoint Server 2007 Training</a></li><li><a href='http://www.coderetard.com/2009/08/11/sharepoint-2010-beta-install-application-server-role-web-server-iis-role/' rel='bookmark' title='Permanent Link: SharePoint 2010 Beta Install: Application Server Role: Web Server (IIS) Role'>SharePoint 2010 Beta Install: Application Server Role: Web Server (IIS) Role</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "SharePoint+Search+Failing%3A+Application+Server+job+failed+for+service+instance";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Was getting this error:Application Server job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (34c9a339-ef4a-454b-a288-812fd2fd1270).Reason: Index was outside the bounds of the array.Techinal Support Details:System.IndexOutOfRangeException:...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Was getting this error:</p>
<p>Application Server job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (34c9a339-ef4a-454b-a288-812fd2fd1270).<br />
<span id="more-218"></span><br />
Reason: Index was outside the bounds of the array.</p>
<p>Techinal Support Details:<br />
System.IndexOutOfRangeException: Index was outside the bounds of the array.<br />
   at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.SynchronizeDefaultContentSource(IDictionary applications)<br />
   at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize()<br />
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)</p>
<p>For more information, see Help and Support Center at <a href="http://go.microsoft.com/fwlink/events.asp.">http://go.microsoft.com/fwlink/events.asp.</a></p>
<p>Solution:</p>
<p>stsadm -o osearch -action stop<br />
Warning: The Office SharePoint Server Search service that was enabled on this server will uninstall and all index files for all SSPs will be deleted. Are you sure you want to permanently delete all data in the index for all SSPs? [y/n]<br />
NOTE: Only do this if you have not crawled / indexed content that cannot be re-indexed. If this is the case, then you open a support ticket with MSFT and work through it. Otherwise, hit Y<br />
Now issue: stsadm -o osearch -action start -role index<br />
You may receive the errror &#8217;start&#8217; action failed. Additional information: the handle is invalid. Wait 30-60 secs and re-issue the command. It should go through fine.<br />
Open Central Admin &#8211; select your SSP<br />
Application Management => Manage Search Service => Shared Services Administration<br />
Check / validate your search service configuration.</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="SharePoint Search Failing: Application Server job failed for service instance " url="http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20&amp;bodytext=Was%20getting%20this%20error%3A%0D%0A%0D%0AApplication%20Server%20job%20failed%20for%20service%20instance%20Microsoft.Office.Server.Search.Administration.SearchServiceInstance%20%2834c9a339-ef4a-454b-a288-812fd2fd1270%29.%0D%0A%0D%0AReason%3A%20Index%20was%20outside%20the%20bounds%20of%20the%20array.%0D%0A%0D%0ATechina" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20&amp;notes=Was%20getting%20this%20error%3A%0D%0A%0D%0AApplication%20Server%20job%20failed%20for%20service%20instance%20Microsoft.Office.Server.Search.Administration.SearchServiceInstance%20%2834c9a339-ef4a-454b-a288-812fd2fd1270%29.%0D%0A%0D%0AReason%3A%20Index%20was%20outside%20the%20bounds%20of%20the%20array.%0D%0A%0D%0ATechina" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;submitHeadline=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20&amp;submitSummary=Was%20getting%20this%20error%3A%0D%0A%0D%0AApplication%20Server%20job%20failed%20for%20service%20instance%20Microsoft.Office.Server.Search.Administration.SearchServiceInstance%20%2834c9a339-ef4a-454b-a288-812fd2fd1270%29.%0D%0A%0D%0AReason%3A%20Index%20was%20outside%20the%20bounds%20of%20the%20array.%0D%0A%0D%0ATechina&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;h=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;t=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F20%2Fsharepoint-search-failing-application-server-job-failed-for-service-instance%2F&amp;title=SharePoint%20Search%20Failing%3A%20Application%20Server%20job%20failed%20for%20service%20instance%20&amp;annotation=Was%20getting%20this%20error%3A%0D%0A%0D%0AApplication%20Server%20job%20failed%20for%20service%20instance%20Microsoft.Office.Server.Search.Administration.SearchServiceInstance%20%2834c9a339-ef4a-454b-a288-812fd2fd1270%29.%0D%0A%0D%0AReason%3A%20Index%20was%20outside%20the%20bounds%20of%20the%20array.%0D%0A%0D%0ATechina" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/29/office-sharepoint-server-2007-training/' rel='bookmark' title='Permanent Link: Office SharePoint Server 2007 Training'>Office SharePoint Server 2007 Training</a></li><li><a href='http://www.coderetard.com/2009/08/11/sharepoint-2010-beta-install-application-server-role-web-server-iis-role/' rel='bookmark' title='Permanent Link: SharePoint 2010 Beta Install: Application Server Role: Web Server (IIS) Role'>SharePoint 2010 Beta Install: Application Server Role: Web Server (IIS) Role</a></li><li><a href='http://www.coderetard.com/2008/12/24/sharepoint-error-and-resolution-sharepoint-failed-to-connect-to-the-configuration-database/' rel='bookmark' title='Permanent Link: SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.'>SharePoint Error and Resolution: SharePoint, Failed to connect to the configuration database.</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/03/20/sharepoint-search-failing-application-server-job-failed-for-service-instance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problem with Aspose.word: System.AccessViolationException</title>
		<link>http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/</link>
		<comments>http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 16:22:27 +0000</pubDate>
		<dc:creator>Son Riku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[doc]]></category>
		<category><![CDATA[downgrade]]></category>
		<category><![CDATA[DS]]></category>
		<category><![CDATA[ea]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[using]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/</guid>
		<description><![CDATA[
		
		
		
		We were using aspose.PDF + aspose.wordÂ on our local dev computers and everything worked fine (windows 2k3 server 32bit)Â  We then deployed to our test server Windows 2k3 64bit and the site blew up. 
Description:System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.Â Â  at á’‹.á‘ª.á–§(BinaryReader àµˆ)Â Â  at [...]


Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/18/how-to-convert-txt-docs-to-pdf-in-aspose/' rel='bookmark' title='Permanent Link: How to Convert Txt Docs to PDF in Aspose c#'>How to Convert Txt Docs to PDF in Aspose c#</a></li><li><a href='http://www.coderetard.com/2008/03/10/automating-word-docs-to-pdf-in-c/' rel='bookmark' title='Permanent Link: Automating Word docs to PDF in c# for SharePoint'>Automating Word docs to PDF in c# for SharePoint</a></li><li><a href='http://www.coderetard.com/2008/05/09/windows-2008-and-sharepoint-2007-dont-play-nice/' rel='bookmark' title='Permanent Link: Windows 2008 and SharePoint 2007 Don&#8217;t Play Nice'>Windows 2008 and SharePoint 2007 Don&#8217;t Play Nice</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Problem+with+Aspose.word%3A+System.AccessViolationException";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "We were using aspose.PDF + aspose.wordÂ on our local dev computers and everything worked fine (windows 2k3 server 32bit)Â  We then deployed to our test server Windows 2k3 64bit and the site blew up. Description:System.AccessViolationException: Attempted...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>We were using aspose.PDF + aspose.wordÂ on our local dev computers and everything worked fine (windows 2k3 server 32bit)Â  We then deployed to our test server Windows 2k3 64bit and the site blew up. <span id="more-158"></span></p>
<p>Description:<o:p></o:p>System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.<o:p></o:p>Â Â  at <span style="font-family: 'Times New Roman','serif'">á’‹</span>.<span style="font-family: 'Times New Roman','serif'">á‘ª</span>.<span style="font-family: 'Times New Roman','serif'">á–§</span>(BinaryReader <span style="font-family: 'Arial Unicode MS','sans-serif'">àµˆ</span>)<o:p></o:p>Â Â  at <span style="font-family: 'Times New Roman','serif'">á‘‡</span>.<span style="font-family: 'Times New Roman','serif'">á‘¢</span>.á„‰(Stream <span style="font-family: 'Arial','sans-serif'">Ùƒ</span>, String <span style="font-family: 'Arial','sans-serif'">Ø¡</span>)<o:p></o:p>Â Â  at <span style="font-family: 'Times New Roman','serif'">á‘‡</span>.<span style="font-family: 'Times New Roman','serif'">á‘†</span>..ctor(Stream stream, String password, Document doc)<o:p></o:p>Â Â  at Aspose.Words.Document.à ¾(Stream <span style="font-family: 'Arial','sans-serif'">Ùƒ</span>, LoadFormat à ¿, String <span style="font-family: 'Arial','sans-serif'">Ø¡</span>)<o:p></o:p></p>
<p class="MsoNormal">Â Â  at Aspose.Words.Document..ctor(Stream stream)</p>
<p class="MsoNormal">Well it turns out it is a known issue.Â  The version of Aspose.word we where using was 5.0.2.Â  Don&#8217;t let that version fool you though, as even though its newer, it wont work on the 64 OS.Â  Their temporary solution right now is do downgrade your product to 5.0.0</p>
<p class="MsoNormal">Â <a href="http://www.aspose.com/community/files/51/file-format-components/aspose.words/entry112260.aspx">http://www.aspose.com/community/files/51/file-format-components/aspose.words/entry112260.aspx</a></p>
<p class="MsoNormal">&nbsp;</p>
<script type="text/javascript" class="owbutton" src="http://www.onlywire.com/btn/button_2" title="Problem with Aspose.word: System.AccessViolationException" url="http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/"></script>
<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow" id="twitter"  target="_blank" href="http://twitter.com/home?status=Problem%20with%20Aspose.word%3A%20System.AccessViolationException%20-%20http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F" title="Twitter"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException&amp;bodytext=We%20were%20using%20aspose.PDF%20%2B%20aspose.word%C3%82%C2%A0on%20our%20local%20dev%20computers%20and%20everything%20worked%20fine%20%28windows%202k3%20server%2032bit%29%C3%82%C2%A0%20We%20then%20deployed%20to%20our%20test%20server%20Windows%202k3%2064bit%20and%20the%20site%20blew%20up.%20%0D%0A%0D%0ADescription%3ASystem.AccessViolationException" title="Digg"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException&amp;notes=We%20were%20using%20aspose.PDF%20%2B%20aspose.word%C3%82%C2%A0on%20our%20local%20dev%20computers%20and%20everything%20worked%20fine%20%28windows%202k3%20server%2032bit%29%C3%82%C2%A0%20We%20then%20deployed%20to%20our%20test%20server%20Windows%202k3%2064bit%20and%20the%20site%20blew%20up.%20%0D%0A%0D%0ADescription%3ASystem.AccessViolationException" title="del.icio.us"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="propeller"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F" title="Propeller"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException" title="Reddit"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="slashdot"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException&amp;url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F" title="Slashdot"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException" title="StumbleUpon"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F" title="Technorati"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException" title="Mixx"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="yahoobuzz"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;submitHeadline=Problem%20with%20Aspose.word%3A%20System.AccessViolationException&amp;submitSummary=We%20were%20using%20aspose.PDF%20%2B%20aspose.word%C3%82%C2%A0on%20our%20local%20dev%20computers%20and%20everything%20worked%20fine%20%28windows%202k3%20server%2032bit%29%C3%82%C2%A0%20We%20then%20deployed%20to%20our%20test%20server%20Windows%202k3%2064bit%20and%20the%20site%20blew%20up.%20%0D%0A%0D%0ADescription%3ASystem.AccessViolationException&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="newsvine"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;h=Problem%20with%20Aspose.word%3A%20System.AccessViolationException" title="NewsVine"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;t=Problem%20with%20Aspose.word%3A%20System.AccessViolationException" title="Facebook"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="google"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.coderetard.com%2F2008%2F03%2F19%2Fproblem-with-asposeword-systemaccessviolationexception%2F&amp;title=Problem%20with%20Aspose.word%3A%20System.AccessViolationException&amp;annotation=We%20were%20using%20aspose.PDF%20%2B%20aspose.word%C3%82%C2%A0on%20our%20local%20dev%20computers%20and%20everything%20worked%20fine%20%28windows%202k3%20server%2032bit%29%C3%82%C2%A0%20We%20then%20deployed%20to%20our%20test%20server%20Windows%202k3%2064bit%20and%20the%20site%20blew%20up.%20%0D%0A%0D%0ADescription%3ASystem.AccessViolationException" title="Google Bookmarks"><img src="http://www.coderetard.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related Posts:<ol><li><a href='http://www.coderetard.com/2008/03/18/how-to-convert-txt-docs-to-pdf-in-aspose/' rel='bookmark' title='Permanent Link: How to Convert Txt Docs to PDF in Aspose c#'>How to Convert Txt Docs to PDF in Aspose c#</a></li><li><a href='http://www.coderetard.com/2008/03/10/automating-word-docs-to-pdf-in-c/' rel='bookmark' title='Permanent Link: Automating Word docs to PDF in c# for SharePoint'>Automating Word docs to PDF in c# for SharePoint</a></li><li><a href='http://www.coderetard.com/2008/05/09/windows-2008-and-sharepoint-2007-dont-play-nice/' rel='bookmark' title='Permanent Link: Windows 2008 and SharePoint 2007 Don&#8217;t Play Nice'>Windows 2008 and SharePoint 2007 Don&#8217;t Play Nice</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.coderetard.com/2008/03/19/problem-with-asposeword-systemaccessviolationexception/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
