<?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>Aneef.Net &#187; visual studio 2008</title>
	<atom:link href="http://www.aneef.net/category/dev-tools/visual-studio-2008/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aneef.net</link>
	<description>Do it in .Net way &#124; Blogging about C#,ASP.Net, LINQ,WPF and .Net Technologies</description>
	<lastBuildDate>Mon, 24 May 2010 10:50:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Scott Guthrie Announces the WebsiteSpark Program</title>
		<link>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/</link>
		<comments>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 10:06:43 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[ScottGu]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[WebSpark]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=104</guid>
		<description><![CDATA[Scott guthrie just did a great announcement about the WebsiteSpark Program. what is WebsiteSpark? WebsiteSpark is designed for independent web developers and web development companies that build web applications and web sites on behalf of others.  It enables you to get software, support and business resources from Microsoft at no cost for three years, and [...]]]></description>
			<content:encoded><![CDATA[<p>Scott guthrie just did a great announcement about the <a href="http://www.microsoft.com/web/websitespark/">WebsiteSpark </a>Program.</p>
<p><strong>what is WebsiteSpark?</strong></p>
<p><span style="font-family: arial; font-size: x-small;"><a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> is designed for independent web developers and web development companies that build web applications and web sites on behalf of others.  It enables you to get software, support and business resources from Microsoft at no cost for three years, and enables you to expand your business and build great web solutions using ASP.NET, Silverlight, SharePoint and PHP, and the <a href="http://www.microsoft.com/web/gallery/default.aspx" target="_blank">open source applications</a> built on top of them.</p>
<h3><span style="text-decoration: underline;">What does the program provide?</span></h3>
<p><a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebSiteSpark</a> provides software licenses that you can use for three years at no cost.  Once enrolled, you can download and immediately use the following software from Microsoft:</p>
<ul>
<li>3 licenses of Visual Studio 2008 Professional Edition</li>
<li>1 license of Expression Studio 3 (which includes Expression Blend, Sketchflow, and Web)</li>
<li>2 licenses of Expression Web 3</li>
<li>4 processor licenses of Windows Web Server 2008 R2</li>
<li>4 processor licenses of SQL Server 2008 Web Edition</li>
<li>DotNetPanel control panel (enabling easy remote/hosted management of your servers)</li>
</ul>
<p>The Windows Server and SQL Server licenses can be used for both development <em>and</em> production deployment.  You can either self-host the servers on your own, or use the licenses with a hoster.  <a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> makes it easy to find hosters who are also enrolled in the program, and who can use your licenses to provide you with either dedicated or virtual dedicated servers to host your sites on.</p>
<p>In addition to software, <a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> provides partner opportunities to grow and build your business (including customer referrals through our partner programs).  It also includes product support (including 2 professional support incidents) and free online training for the products.</p>
<p>for further information on this visit Scotts blog <a href="http://weblogs.asp.net/scottgu/archive/2009/09/24/announcing-the-websitespark-program.aspx">here.</a></p>
<p>Thanks Scott for the great information <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p></span></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=104&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART III &#8211; Pushing .net Framework 3.5</title>
		<link>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/</link>
		<comments>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 11:33:24 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[.Net Installation.]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Check .Net Framework]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/</guid>
		<description><![CDATA[In the last few weeks I wrote 2 articles on how to resolve ClickOnce certificate expiration issues. you can find those articles here : ClickOnce Application,Expired Certificates &#38; Public Key Token PART I ClickOnce Application,Expired Certificates &#38; Public Key Token PART II During my work on this ClickOnce update, we decided to upgrade the application [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few weeks I wrote 2 articles on how to resolve ClickOnce certificate expiration issues. you can find those articles here :</p>
<ol>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/">ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</a>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/">ClickOnce Application,Expired Certificates &amp; Public Key Token PART II</a> </li>
</ol>
<ol>During my work on this ClickOnce update, we decided to upgrade the application to target .net framework 3.5 sp1.</ol>
<ol>so I just set the target framework to 3.5 and set the required prerequisites (.net 3.5 SP1, and Windows Installer 3.1). and built the project and published it. and when I tried on a client machine which had .net framework 2.0, application got updated, prompted the uninstall message, and tried to launch the new ClickOnce application from the new URL, and BANG!. we get an error :</ol>
<ol><a href="http://www.aneef.net/wp-content/uploads/2009/07/image001.jpg"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image001" src="http://www.aneef.net/wp-content/uploads/2009/07/image001_thumb.jpg" width="286" height="142"></a></ol>
<ol>The Error Message Says :</ol>
<blockquote><p>Unable to install or run the application. The application</p>
<p>requires that assembly WindowsBase Version 3.0.0.0 be</p>
<p>installed in the Global Assembly Cache (GAC) first.</p>
</blockquote>
<p>Why is this ?, its because when we try to launch the new application URL we do this :</p>
<pre>DeploymentUtils.AutoInstall("&lt;Path toNewApplication.application&gt;");</pre>
<pre>&nbsp;</pre>
<p>we request for the application manifest. and it fails to launch the application because it doesn&#8217;t have the prerequisites. and now to force the new prerequisites the application should call the setup.exe in the Web Server instead of the manifest. now the question is, what if the user already have&nbsp; the .net Framework 3.5 SP1?, we don&#8217;t have to prompt the client to install them again by launching setup.exe, we just have to launch the manifest. To Serve both the above scenario we need to check if the client machine has .net framework 3.5 SP1, and depending on its availability we need to launch the manifest or the setup.exe. The existence of .net Framework can be obtained from the following registry location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP <a href="http://www.aneef.net/wp-content/uploads/2009/07/image.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/07/image_thumb.png" width="544" height="216"></a> you can find out all the .net Frameworks installed and their service pack versions in this registry entry. Following are the locations of the main Net Frameworks:</p>
<table border="0" cellspacing="0" cellpadding="2" width="540">
<tbody>
<tr>
<td valign="top" width="128">Framework 1.1</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v1.1.4322</td>
</tr>
<tr>
<td valign="top" width="128">Framework 2.0</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727</td>
</tr>
<tr>
<td valign="top" width="128">Framework 3.0</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v3.0\\Setup</td>
</tr>
<tr>
<td valign="top" width="128">Framework 3.5</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Now we can check if the required .net Framework is available in the client machine, and launch the application setup.exe or the manifest. to do this we need to programmatically check these registries. for this I used the attached code ( I Couldn&#8217;t find the original author, Credits goes to him/her) which I found from web and modified to avoid few bugs. you can add this code to your project and do the below check in your application to decide which file to be launched :</p>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode"><span class="kwrd">string</span> FileToLaunch=<span class="str">@"/setup.exe"</span>;
<span class="kwrd">if</span> (FrameworkUtils.IsInstalled(FrameworkVersion.Fx35)

 &amp;&amp; FrameworkUtils.GetServicePackLevel(FrameworkVersion.Fx35) == 1)
          {
            FileToLaunch = <span class="str">@"/&lt;application manifest.application&gt;"</span>;
          }
            MessageBox.Show(<span class="str">"Your message here"</span>);
            <span class="kwrd">string</span> updateURL = DeploymentUtils.getUpdateURL();
            DeploymentUtils.UninstallMe();
            DeploymentUtils.AutoInstall(<span class="str">"https://"</span> + updateURL + FileToLaunch);
            Application.Exit();</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<pre class="csharpcode">&nbsp;</pre>
<p>And that&#8217;s all, now the application will launch the setup.exe if the client doesn&#8217;t have the .net Framework 3.5 and prompt for its installation, or launch the application manifest if client has the framework installed.</p>
<p>Now you can solve your ClickOnce issue as well as upgrade .net Framework in client machine at the same time without problem.</p>
<p><a href="wp-content/uploads/2009/07/FrameworkUtil.cs.txt">Download FrameworkUtils.cs</a></p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=97&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Request UAC Elevation for .net Application (Managed Code)</title>
		<link>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/</link>
		<comments>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:35:48 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[Application Manifest]]></category>
		<category><![CDATA[mt.exe]]></category>
		<category><![CDATA[Permission]]></category>
		<category><![CDATA[UAC]]></category>
		<category><![CDATA[User Account Control]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[WindowsPrincipal]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/</guid>
		<description><![CDATA[Its about time for us to get ready for Windows 7. and most of us have to develop applications compatible to Windows 7, Vista, and Server 2008. and sometimes we need applications to run with administrative privileges. and that&#8217;s not a big deal. but in these new Operating Systems, even an administrator is sometimes locked [...]]]></description>
			<content:encoded><![CDATA[<p>Its about time for us to get ready for <a href="http://www.microsoft.com/windows/windows-7/" target="_blank">Windows 7</a>. and most of us have to develop applications compatible to Windows 7, Vista, and Server 2008. and sometimes we need applications to run with administrative privileges. and that&#8217;s not a big deal. but in these new Operating Systems, even an administrator is sometimes locked by the <a href="http://en.wikipedia.org/wiki/User_Account_Control" target="_blank">UAC</a> when running some applications.</p>
<p>some applications might throw exceptions in such situation, when we need administrative privileges to do some task, if they don’t request for UAC elevation by the application. only option to make these application is to right click and select “Run as Administrator” to manually trigger UAC.</p>
<p>In this post I’m going to show how to request for UAC Elevation for a .net Application. this explains the use of <a href="http://msdn.microsoft.com/en-us/library/aa374191(VS.85).aspx" target="_blank">Application Manifests</a> that request the OS for UAC elevation. </p>
<p>&#160;</p>
<h2>Code</h2>
<p>I have my sample windows form C# Project with a single form that shows a message box on form load,showing whether you are an administrator or not.</p>
<p>&#160;</p>
<pre class="csharpcode">  <span class="kwrd">private</span> <span class="kwrd">void</span> Form1_Load(<span class="kwrd">object</span> sender, EventArgs e)
        {
         <span class="kwrd">bool</span> isAdmin = <span class="kwrd">new</span> WindowsPrincipal(WindowsIdentity.GetCurrent())</pre>
<pre class="csharpcode">                   .IsInRole(WindowsBuiltInRole.Administrator) ? <span class="kwrd">true</span> : <span class="kwrd">false</span>;

            <span class="kwrd">if</span>(isAdmin)
            {
                MessageBox.Show(<span class="str">&quot;you are an administrator&quot;</span>);
            }
            <span class="kwrd">else</span>
            {
                MessageBox.Show(<span class="str">&quot;You are not an administrator&quot;</span>);
            }
        }</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>in the above code we use <a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsprincipal.aspx" target="_blank">WindowsPrincipal</a> class, which allows us to check the Windows group membership of a Windows user. to use this classes un need to use the following namespace in the code:</p>
<pre class="csharpcode"><span class="kwrd">using</span> System.Security.Principal;</pre>
<pre class="csharpcode">&#160;</pre>
<p>when you compile this application and run , you would expect that it will show the message saying “you are an administrator” if you are logged in as an administrator account. well this is what you get if you have UAC enabled, not something you expected right ?</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb.png" width="221" height="156" /></a> </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>ok now we need to make our application to request for UAC elevation.&#160; first we need to create a manifest file with the application name.</p>
<h2>Create Manifest File</h2>
<p>First add a new item to the project with the name with following format, &lt;applicationname&gt;.exe.manifest . in our case (ElevationTest.exe.manifest). and add the following XML:</p>
<pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;UTF-8&quot;</span> <span class="attr">standalone</span><span class="kwrd">=&quot;yes&quot;</span>?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">assembly</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;urn:schemas-microsoft-com:asm.v1&quot;</span> <span class="attr">manifestVersion</span><span class="kwrd">=&quot;1.0&quot;</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">assemblyIdentity</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0.0.0&quot;</span>  <span class="attr">name</span><span class="kwrd">=&quot;ElevationTest&quot;</span> <span class="attr">type</span><span class="kwrd">=&quot;win32&quot;</span><span class="kwrd">/&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">trustInfo</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;urn:schemas-microsoft-com:asm.v3&quot;</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">security</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;</span><span class="html">requestedPrivileges</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">requestedExecutionLevel</span> <span class="attr">level</span><span class="kwrd">=&quot;requireAdministrator&quot;</span><span class="kwrd">/&gt;</span>
         <span class="kwrd">&lt;/</span><span class="html">requestedPrivileges</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;/</span><span class="html">security</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">trustInfo</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">assembly</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<p>and the next step is to add the manifest in to the built executables Win32Resources by embedding it.&#160; to do this we need to use the MT.exe in the .Net SDK.&#160; by default it can be found in “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\”.</p>
<p>we can use the following command to embed the manifest through visual studio command line:</p>
<p><strong>mt.exe –manifest MyApp.exe.manifest -outputresource:MyApp.exe;1</strong> </p>
<p>or </p>
<p><strong>mt.exe –manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2</strong> </p>
<p>(1 for an EXE, 2 for a DLL.) </p>
<p>to make things easier we can add this command to the postbuild event of the project :</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb1.png" width="549" height="328" /></a><br />
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>below is the full&#160; post build command:</p>
<p>&quot;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\mt.exe&quot; -manifest &quot;$(ProjectDir)$(TargetName).exe.manifest&quot;&#160; –outputresource:&quot;$(TargetDir)$(TargetFileName)&quot;;#1</p>
<p>once you have built the application successfully if you see the output directory you will see the icons will have a shield on them indicating that the application requires UAC elevation.</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb2.png" width="322" height="159" /></a> </p>
<p>And now if you run your built application it will prompt for UAC : and when you click on allow the application will show you the following Message : </p>
<p>&#160;</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb3.png" width="199" height="156" /></a> </p>
<p>That’s it you have your application ready to request UAC Elevation in the new operating systems.</p>
<p>&#160;</p>
<p>hope it helps.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.aneef.net%2f2009%2f06%2f29%2frequest-uac-elevation-for-net-application-managed-code%2f"><img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.aneef.net%2f2009%2f06%2f29%2frequest-uac-elevation-for-net-application-managed-code%2f" /></a></p>
<p><!-- BEGIN SMOWTION TAG - 468x60 - aneef net: tecnologia - DO NOT MODIFY --><br />
<script type="text/javascript"><!--
smowtion_size = "468x60";
smowtion_section = "642940";
//-->
</script><br />
<script type="text/javascript" src="http://ads.smowtion.com/ad.js">
</script><br />
<!-- END SMOWTION TAG - 468x60 - aneef net: tecnologia - DO NOT MODIFY --></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=87&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART II</title>
		<link>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/</link>
		<comments>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 10:40:36 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Public Token Key]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/</guid>
		<description><![CDATA[In the first part of this series I wrote the possible solutions available for the ClicOnce certificate issue. if you have missed it please read it before continuing. ClickOnce Application,Expired Certificates &#38; Public Key Token PART I This post is not going to be a long one, I&#160; just want to point out a very [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">first part</a> of this series I wrote the possible solutions available for the ClicOnce certificate issue. if you have missed it please read it before continuing.</p>
<ol>
<ol>
<ul>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</a></li>
</ul>
<ul>This post is not going to be a long one, I&nbsp; just want to point out a very important issue, when updating the ClickOnce using the method specified in <a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">PART I</a> . </ul>
<ul>When using <a href="http://www.jamesharte.com/blog/?p=11" target="_blank">Jim Harte&#8217;s</a> Method to update a ClickOnce with a new certificate, it checks for the public token key of the current application to find its uninstall string, and then execute runDLL32 to trigger the uninstall. below is the code which gets the uninstall string:</ul>
<ul></ul>
<ol>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Gets the uninstall string for the current ClickOnce app from the Windows </span>
<span class="rem">/// Registry.</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="rem">/// &lt;param name="PublicKeyToken"&gt;The public key token of the app.&lt;/param&gt;</span>
<span class="rem">/// &lt;returns&gt;The command line to execute that will uninstall the app.&lt;/returns&gt;</span>
 <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GetUninstallString(<span class="kwrd">string</span> PublicKeyToken,</pre>
<pre class="csharpcode">                          <span class="kwrd">out</span> <span class="kwrd">string</span> DisplayName)
{
 <span class="kwrd">string</span> uninstallString = <span class="kwrd">null</span>;
 <span class="kwrd">string</span> searchString = <span class="str">"PublicKeyToken="</span> + PublicKeyToken;
 RegistryKey uninstallKey = _
      Registry.CurrentUser.OpenSubKey</pre>
<pre class="csharpcode">                (<span class="str">"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"</span>);
 <span class="kwrd">string</span>[] appKeyNames = uninstallKey.GetSubKeyNames();
 DisplayName = <span class="kwrd">null</span>;
 <span class="kwrd">foreach</span>(<span class="kwrd">string</span> appKeyName <span class="kwrd">in</span> appKeyNames)
{
  RegistryKey appKey = uninstallKey.OpenSubKey(appKeyName);
  uninstallString = (<span class="kwrd">string</span>)appKey.GetValue(<span class="str">"UninstallString"</span>);
  DisplayName = (<span class="kwrd">string</span>)appKey.GetValue(<span class="str">"DisplayName"</span>);
  appKey.Close();

 <span class="kwrd">if</span>(uninstallString.Contains(searchString))
                    <span class="kwrd">break</span>;
 }
            uninstallKey.Close();
            <span class="kwrd">return</span> uninstallString;
        }</pre>
<pre class="csharpcode">&nbsp;</pre>
<p>&nbsp;</p>
<p>In the above code it goes through registry keys of all ClickOnce application to get the uninstall string. and if that uninstall string contains the Public Token key of the current application, it will uninstall the application with that particular uninstall string. this is completely ok if there is only one application with that public token key. <strong>the public key of an assembly name identifies the developer (or the organization). Most organizations use only one public key to sign their assemblies with</strong>. so what if there is more than 1 application which has the same public token key?</p>
</ol>
<li>The code will uninstall the very first match in the above code and it might uninstall some other application, instead of uninstalling the one we need to uninstall.
<li>and it will&nbsp; also install the new application from new URL, but with a different name sometimes (Eg: application name -1).
<li>And if it had uninstalled another application, whenever user launches this application it will prompt the uninstall screen, each time when there are more than 1 application with the same public token key.</li>
</ol>
</ol>
<p>The Image below shows an uninstall string, which contains the application name, and public token key:</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/debug.jpg"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="debug" src="http://www.aneef.net/wp-content/uploads/2009/06/debug-thumb.jpg" width="558" height="102"></a> </p>
<p>To avoid this problem of wrong application getting uninstalled, I changed this part of the code from above code to :</p>
<pre class="csharpcode"><span class="kwrd">if</span>(uninstallString.Contains(searchString)) <span class="kwrd">break</span>; </pre>
<p><style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</p>
<p>this:</p>
<pre class="csharpcode"><span class="kwrd">if</span>(uninstallString.Contains(searchString)
               &amp;&amp; uninstallString.Contains(<span class="str">"yourApp.application"</span>))
                    <span class="kwrd">break</span>;</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<ol>
<ol>
<ol>
<p>&nbsp;</p>
<p>In the code above, I&#8217;m Checking the ClickOnce application name with extension, along with the public token key to find out the correct uninstall string. that&#8217;s it!. </p>
<p>Hope this solves your time in someway. </p>
<p><style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</p>
</ol>
</ol>
</ol>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=73&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</title>
		<link>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/</link>
		<comments>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 09:05:36 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[thawte]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[verisign]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/</guid>
		<description><![CDATA[Well, by this time I&#8217;m sure most of the ClickOnce application developers are aware of this problem. if you aren&#8217;t here is a basic description of what the problem is: Problem description ClickOnce allows application updates, only if the updated application manifests are signed with the same certificate (publisher) as was used to originally sign [...]]]></description>
			<content:encoded><![CDATA[<p>Well, by this time I&#8217;m sure most of the ClickOnce application developers are aware of this problem. if you aren&#8217;t here is a basic description of what the problem is:</p>
<blockquote style="width: 85%; height: 285px"><p><strong>Problem description</strong></p>
<p>ClickOnce allows application updates, only if the updated application manifests are signed with the same certificate (publisher) as was used to originally sign the application manifests. However, most CA&#8217;s like Verisign, and many enterprise customers own CA&#8217;s generate new certificates with new key pairs and only the same common name (CN). </p>
<p>The certificate is used for the Authenticode signature element and for the strong name signature element of the manifest file to protect it against tampering, and to provide identity information for the trust manager. If the signing certificate expires and you publish an application update with a renewed certificate which has different keys, then the update will fail with the error message described in the <a href="http://support.microsoft.com/kb/925521/en-us" target="_blank">KB article.</a></p>
</blockquote>
<p>&nbsp;</p>
<p>There are lots of issues, and threads are being discussed how to resolve this issue. and these are the preferable solutions available on net.</p>
<ol>
<li>Manually Uninstall and Re install the application with new certificate &#8211; which we cannot do when we have a large number of client base who are using our ClickOnce Applicaiton.
<li>Install .net Framework 2.0 SP1 for XP /&nbsp; .Net Framework 3.5 SP1 for vista or later, in these service pack s for .net Framework, this bug is fixed, and it will seamlessly update the application. &#8211; but we cannot force or inform clients to do that. yeah by this time most of the users might have installed .net framework 3.5 sp1 through windows automatic updates. but even if one guy haven&#8217;t done that KABOOM!!, clients are going to complain.
<li>Sign the new click once with 2 different keys &#8211; a solution by <a href="http://blogs.msdn.com/danielma/contact.aspx">Daniel Margetic</a> , even though developers may like it, when considering Automation, and&nbsp; Infrastructure of build servers this might not be a favorite solution.
<li>Automatically Uninstalling the old application, and re-install the new application. &#8211; a solution by <a href="http://www.jamesharte.com/blog/?p=11" target="_blank">Jim Harte</a> , using this method, we will be releasing an update for the application with expired certificate, which will have scripts for automatically uninstall the applicaiton, and install the application with new certificate, from a new location. the following thread on MSDN explains this process completely: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1217520d-6dc4-4fb1-83d1-0fa148d60e5d" target="_blank">VS2008 SP-1 change certificate, user can&#8217;t pick up update</a> </p>
<p>The last one seems to be a favorite of most of the people around the globe. it uses <a href="http://www.jamesharte.com/downloads/ClickOnceReinstall.zip" target="_blank">these classes</a> by&nbsp; Jim Harte&nbsp; to uninstall and re install the application, using the following code: </li>
</ol>
<pre class="csharpcode">MessageBox.Show(<span class="str">"Your Message to Client"</span>);
DeploymentUtils.UninstallMe()
DeploymentUtils.AutoInstall(<span class="str">"&lt;Path toNewApplication.application&gt;"</span>);
Application.Exit();</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&nbsp;</p>
<p>you can have the new path as a sub folder of current applications update URL. you can get a ClickOnce applicaitons update URL using the line below :</p>
<pre class="csharpcode">ApplicationDeployment.CurrentDeployment.UpdateLocation.Host</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>That would do the trick. so what is it about Public Token Key ??. I will explain this in the PART 2 of this article.</p>
<p>Hope it helps,</p>
<p>Aneef</p>
<p><strong>I just posted the Part II of this series is </strong><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/"><strong>here</strong></a><strong>.</strong></p>
<p><strong>Special Note:</strong></p>
<p>Thanks to <a href="http://robindotnet.wordpress.com/" target="_blank">RobinDotNet</a> for his wonderful support through MSDN and through his blog to solve this problem.</p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=69&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Uploading Binary files or Images using LINQ to SQL</title>
		<link>http://www.aneef.net/2009/01/16/uploading-binary-files-or-images-using-linq-to-sql/</link>
		<comments>http://www.aneef.net/2009/01/16/uploading-binary-files-or-images-using-linq-to-sql/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 09:34:34 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[LINQ]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/01/16/uploading-binary-files-or-images-using-linq-to-sql/</guid>
		<description><![CDATA[Today I received an email from a friend, asking how to save a binary file in to the database using LINQ to SQL.  This was the second time a person had asked me the same question, So I thought of having a blog entry about it. Assume that we need to upload a file  and [...]]]></description>
			<content:encoded><![CDATA[<p>Today I received an email from a friend, asking how to save a binary file in to the database using LINQ to SQL.  This was the second time a person had asked me the same question, So I thought of having a blog entry about it.</p>
<p>Assume that we need to upload a file  and save its name, and the file in the database table. so lets see how we do it.</p>
<p><strong>This is my Table</strong></p>
<pre class="csharpcode"><span class="kwrd">CREATE</span> <span class="kwrd">TABLE</span> [dbo].[Files2](
    [ID] [<span class="kwrd">int</span>] <span class="kwrd">IDENTITY</span>(1,1) <span class="kwrd">NOT</span> <span class="kwrd">NULL</span>,
    [FileName] [<span class="kwrd">varchar</span>](50) <span class="kwrd">NOT</span> <span class="kwrd">NULL</span>,
    [FileSource] [image] <span class="kwrd">NOT</span> <span class="kwrd">NULL</span>,
 )
<span class="kwrd">GO</span></pre>
<pre class="csharpcode">And The Following Stored Procedure is used to Insert the Value:</pre>
<pre class="csharpcode"> </pre>
<pre class="csharpcode"><span class="kwrd">CREATE</span> <span class="kwrd">PROCEDURE</span> [dbo].[ADDFILE]
(
    @FILENAME <span class="kwrd">VARCHAR</span>(50),
    @FILESOURCE image
)
<span class="kwrd">AS</span>
<span class="kwrd">SET</span> NOCOUNT <span class="kwrd">ON</span>

INSERT <span class="kwrd">INTO</span> Files([FileName],[FileSource])
<span class="kwrd">VALUES</span>(@FILENAME,@FILESOURCE)</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>And the following code is used to upload and save the file using web form with a text box for file name, and a file upload control to upload the file. on the click event of a button this code is called.</p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">void</span> Button1_Click(<span class="kwrd">object</span> sender, EventArgs e)
{

     <span class="kwrd">if</span> (FileUploader.HasFile &amp;&amp; FileUploader.PostedFile.ContentLength &gt; 0)
      {
          <span class="kwrd">string</span> filename = txtFileName.Text;
          <span class="rem">//Read the file in to a byte Array.</span>
          <span class="kwrd">byte</span>[] filebyte = FileUploader.FileBytes;

    System.Data.Linq.Binary fileBinary = <span class="kwrd">new</span> System.Data.Linq.Binary(filebyte);
          MyDataDataContext MyData = <span class="kwrd">new</span> MyDataDataContext();

          MyData.ADDFILE(filename, fileBinary);
          lblStatus.Text = <span class="str">"File Uploaded Successfully!"</span>;

        }
}</pre>
<pre class="csharpcode"> </pre>
<pre class="csharpcode"> </pre>
<p>The Main thing to remember here is that we need to pass the FileUploader.FileBytes  to the constructor of <a href="http://msdn.microsoft.com/en-us/library/system.data.linq.binary.aspx" target="_blank">System.Data.Linq.Binary</a>.</p>
<p>To Learn more about LINQ to SQL Please visit <a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx" target="_blank">Here</a>.</p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<pre class="csharpcode"><strong><em> EDIT:</em></strong><em> Richie </em><em>just showed another way to achieve this in his blog </em><a href="http://hengrr.wordpress.com/2009/02/20/linq-to-sql-upload-binary-file/" target="_blank"><em>here</em></a><em>.</em></pre>
<pre class="csharpcode"> </pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3530459083226419";
/* Image only In POst */
google_ad_slot = "2791845940";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=39&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/01/16/uploading-binary-files-or-images-using-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>44 Silverlight 2.0 Videos</title>
		<link>http://www.aneef.net/2008/08/02/44-silverlight-20-videos/</link>
		<comments>http://www.aneef.net/2008/08/02/44-silverlight-20-videos/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 19:35:10 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2008/08/02/44-silverlight-20-videos/</guid>
		<description><![CDATA[Are you searching  for webcasts to learn about Microsoft Silverlight 2.0 ? well then, here is a good news for you all.Mike Taulty recently uploaded and amazing collection of Silverlight 2.0 screencasts on how Silverlight works, controls, File IO, networking, UI design,  data-binding, interacting with HTML pages, and more.if you want to have a good [...]]]></description>
			<content:encoded><![CDATA[<p>Are you searching  for webcasts to learn about <a href="http://silverlight.net/default.aspx">Microsoft Silverlight </a>2.0 ? well then, here is a good news for you all.<a href="http://mtaulty.com/communityserver/blogs/mike_taultys_blog/default.aspx">Mike Taulty</a> recently uploaded and amazing collection of Silverlight 2.0 screencasts on how Silverlight works, controls, File IO, networking, UI design,  data-binding, interacting with HTML pages, and more.if you want to have a good start on Silverlight, then go get them!. it will help you for sure.</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2008/08/windowslivewriter44silverlight20videos-1031silverlight-2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.aneef.net/wp-content/uploads/2008/08/windowslivewriter44silverlight20videos-1031silverlight-thumb.png" border="0" alt="silverlight" width="244" height="184" /></a></p>
<ol>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Hello-World/"><strong>Silverlight &#8211; Hello World</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Anatomy-of-an-Application/"><strong>Silverlight &#8211; Anatomy of an Application</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-The-VS-Environment/"><strong>Silverlight &#8211; The VS Environment</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Content-Controls/"><strong>Silverlight &#8211; Content Controls</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Built-In-Controls/"><strong>Silverlight &#8211; Built-In Controls</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Width-Height-Margins-Padding-Alignment/"><strong>Silverlight &#8211; Width, Height, Margins, Padding, Alignment</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-a-GridSplitter/"><strong>Silverlight &#8211; Using a GridSplitter</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Grid-Layout/"><strong>Silverlight &#8211; Grid Layout</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-StackPanel-Layout/"><strong>Silverlight &#8211; StackPanel Layout</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Canvas-Layout/"><strong>Silverlight &#8211; Canvas Layout</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Databinding-UI-to-NET-Classes/"><strong>Silverlight &#8211; Databinding UI to .NET Classes</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Simple-Styles/"><strong>Silverlight &#8211; Simple Styles</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Custom-Types-in-XAML/"><strong>Silverlight &#8211; Custom Types in XAML</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Binding-with-Conversion/"><strong>Silverlight &#8211; Binding with Conversion</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-List-Based-Data-Binding/"><strong>Silverlight &#8211; List Based Data Binding</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Simple-User-Control/"><strong>Silverlight &#8211; Simple User Control</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Templating-a-Button/"><strong>Silverlight &#8211; Templating a Button</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Resources-from-XAPDLLSite-Of-Origin/"><strong>Silverlight &#8211; Resources from XAP/DLL/Site Of Origin</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Animations--Storyboards/"><strong>Silverlight &#8211; Animations &amp; Storyboards</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Uploads-with-WebClient/"><strong>Silverlight &#8211; Uploads with WebClient</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Downloads-with-WebClient/"><strong>Silverlight &#8211; Downloads with WebClient</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Calling-HTTPS-Web-Services/"><strong>Silverlight &#8211; Calling HTTPS Web Services</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Calling-Web-Services/"><strong>Silverlight &#8211; Calling Web Services</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Making-Cross-Domain-Requests/"><strong>Silverlight &#8211; Making Cross Domain Requests</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-HttpWebRequest/"><strong>Silverlight &#8211; Using HttpWebRequest</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-File-Dialogs-and-User-Files/"><strong>Silverlight &#8211; File Dialogs and User Files</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-Sockets/"><strong>Silverlight &#8211; Using Sockets</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-Isolated-Storage/"><strong>Silverlight &#8211; Using Isolated Storage</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-NET-Code-Modifying-HTML/"><strong>Silverlight &#8211; .NET Code Modifying HTML</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-Isolated-Storage-Quotas/"><strong>Silverlight &#8211; Using Isolated Storage Quotas</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Calling-JavaScript-from-NET/"><strong>Silverlight &#8211; Calling JavaScript from .NET</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Evaluating-JavaScript-from-NET-Code/"><strong>Silverlight &#8211; Evaluating JavaScript from .NET Code</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Handling-HTML-Events-in-NET-Code/"><strong>Silverlight &#8211; Handling HTML Events in .NET Code</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Handling-NET-Events-in-JavaScript/"><strong>Silverlight &#8211; Handling .NET Events in JavaScript</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Calling-NET-from-JavaScript/"><strong>Silverlight &#8211; Calling .NET from JavaScript</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Displaying-a-Custom-Splash-Screen/"><strong>Silverlight &#8211; Displaying a Custom Splash Screen</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Passing-Parameters-from-your-Web-Page/"><strong>Silverlight &#8211; Passing Parameters from your Web Page</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Loading-Media-at-Runtime/"><strong>Silverlight &#8211; Loading Media at Runtime</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Dynamically-Loading-AssembliesCode/"><strong>Silverlight &#8211; Dynamically Loading Assemblies/Code</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-ReadingWriting-XML/"><strong>Silverlight &#8211; Reading/Writing XML</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Using-Silverlight-Streaming/"><strong>Silverlight &#8211; Multiple Threads with BackgroundWorker</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-InsertUpdateDelete-with-the-DataGrid/"><strong>Silverlight &#8211; Insert/Update/Delete with the DataGrid</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Getting-Started-with-the-DataGrid/"><strong>Silverlight &#8211; Getting Started with the DataGrid</strong></a></li>
<li><a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-Embedding-Custom-Fonts/"><strong>Silverlight &#8211; Embedding Custom Fonts</strong></a></li>
</ol>
<ol>Thats it!. Have  a great weekend!!.</ol>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3530459083226419";
/* testadd */
google_ad_slot = "3104422232";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=35&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2008/08/02/44-silverlight-20-videos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FREE &#8211; Visual Studio 2008 Professional Edition &amp; Expression Studio For Students</title>
		<link>http://www.aneef.net/2008/04/17/free-visual-studio-2008-professional-edition-expression-studio-for-students/</link>
		<comments>http://www.aneef.net/2008/04/17/free-visual-studio-2008-professional-edition-expression-studio-for-students/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 06:11:25 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[MSDN]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2008/04/17/free-visual-studio-2008-professional-edition-expression-studio-for-students/</guid>
		<description><![CDATA[Well Last February Microsoft Announced Dreamspark. which provides free downloads of professional developer tools for students. but it seems a lot of students doesnt know about it. so i thought i could inform you all, in case if you had missed it. DreamSpark is simple, it&#8217;s all about giving students Microsoft professional-level developer and design [...]]]></description>
			<content:encoded><![CDATA[<p>Well Last February Microsoft Announced <a target="_blank" href="https://downloads.channel8.msdn.com/Overview.aspx">Dreamspark</a>. which provides free downloads of professional developer tools for students. but it seems a lot of students doesnt know about it. so i thought i could inform you all, in case if you had missed it.</p>
<p><img src="http://blogs.msdn.com/blogfiles/joestagner/WindowsLiveWriter/FREEProfessionalDeveloperandDesignertoo_119C1/DreamSpark_thumb.png" /></p>
<p>DreamSpark is simple, it&#8217;s all about giving students Microsoft professional-level developer and design tools <strong>at no charge</strong> so you can chase your dreams and create the next big breakthrough in technology &#8211; or just get a head start on your career.</p>
<p>Here are some of the products it gives for free <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a target="_blank" href="https://downloads.channel8.msdn.com/Products/Visual_Studio_2008.aspx"><img src="https://downloads.channel8.msdn.com/images/en-US/product_images_default/VS2008_home_button.gif" /></a></p>
<p><a target="_blank" href="https://downloads.channel8.msdn.com/Products/Expression_Studio.aspx"><img src="https://downloads.channel8.msdn.com/images/en-US/product_images_default/exp_home_button.gif" /></a></p>
<p><a target="_blank" href="https://downloads.channel8.msdn.com/Products/Windows_Server_2003.aspx"><img src="https://downloads.channel8.msdn.com/images/en-US/product_images_default/winserver_home_button.gif" /></a></p>
<p><a target="_blank" href="https://downloads.channel8.msdn.com/Products/XNA_Game_Studio.aspx"><img src="https://downloads.channel8.msdn.com/images/en-US/product_images_default/XNA_home_button.gif" /></a></p>
<p>For more info visit Dreamspark Home <a target="_blank" href="https://downloads.channel8.msdn.com/Default.aspx">here.</a></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=22&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2008/04/17/free-visual-studio-2008-professional-edition-expression-studio-for-students/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 Table Valued Parameters</title>
		<link>http://www.aneef.net/2007/12/23/sql-server-2008-table-valued-parameters/</link>
		<comments>http://www.aneef.net/2007/12/23/sql-server-2008-table-valued-parameters/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 15:36:13 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ADO.net]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[OPENXML]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[Table Valued Parameters]]></category>
		<category><![CDATA[UDT]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2007/12/23/sql-server-2008-table-valued-parameters/</guid>
		<description><![CDATA[Last two weeks I have been working on developing bulk data manipulations. And even before that I always wondered “What&#8217;s the best way to pass an array of values into a SQL Server stored procedure.” One option I found was OPENXML, which I blogged here. And I was trying out visual studio 2008 and SQL [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span>Last two weeks I have been working on developing bulk data manipulations. And even before that I always wondered “</span>What&#8217;s the best way to pass an array of values into a SQL Server stored procedure.” One option I found was <a href="http://www.aneef.net/2007/12/18/adonet-openxml-to-perform-bulk-database-operations/">OPENXML</a>, which I blogged <a href="http://www.aneef.net/2007/12/18/adonet-openxml-to-perform-bulk-database-operations/">here</a>.</p>
<p><!--adsense#largebox--></p>
<p class="MsoNormal">
<p>And I was trying out visual studio 2008 and SQL server 2008 these days. And last night I found out that SQL server now support Tabled valued Parameters which allow us to send data tables as parameters to stored procedures. It still uses the same ADO.Net API.</p>
<p class="MsoNormal">Now I’m going to show how it works. For this I’m using the same scenario which I used in my <a href="http://www.aneef.net/2007/12/18/adonet-openxml-to-perform-bulk-database-operations/">previous post</a> (reading contents of a folder and saving their information). here i have used <a href="http://www.microsoft.com/sql/2008/default.mspx" target="_blank">sql server 2008 november ctp</a> and <a href="http://www.microsoft.com/express/vcsharp/Default.aspx">visual  c# 2008 express edition</a>.</p>
<p class="MsoNormal">First create the table given below:</p>
<blockquote>
<h5><em><span style="font-family: 'Cambria','serif'; color: blue">CREATE TABLE</span></em><em><span style="font-family: 'Cambria','serif'"> FileDetails(<br />
FileName varchar(50) </span></em><em><span style="font-family: 'Cambria','serif'; color: blue">PRIMARY KEY</span></em><em><span style="font-family: 'Cambria','serif'">,<br />
CreatedDate varchar(50) ,<br />
Size </span></em><em><span style="font-family: 'Cambria','serif'; color: blue">decimal</span></em><em><span style="font-family: 'Cambria','serif'">(18, 0) )</span></em></h5>
</blockquote>
<p class="MsoNormal">
<p class="MsoNormal">
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val=" " /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--></p>
<p><!--   /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --></p>
<p><!--[if gte mso 10]></p>
<p><mce:style><!    /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;}  --></p>
<p><!--[endif]--></p>
<p class="MsoNormal">Then, we should declare a new Table User Defined Type in the database:</p>
<blockquote>
<p class="MsoNormal">create type FileDetailsType as table<br />
(<br />
<span> </span><span> </span>FileName<span> </span>varchar(50),<br />
<span> </span>CreatedDate<span> </span>varchar(50),<br />
<span> </span>Size<span> </span>decimal(18,0)<br />
)</p></blockquote>
<p class="MsoNormal">
<p class="MsoNormal">
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val=" " /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><br />
<!--   /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 27.0pt 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --></p>
<p><!--[if gte mso 10]></p>
<p><mce:style><!    /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;}  --></p>
<p><!--[endif]--></p>
<p class="MsoNormal">Then create a stored procedure that gets a parameter of the above type, and inserts many rows in a single command.</p>
<blockquote>
<p class="MsoNormal">create procedure InsertFileDetails<br />
(<br />
<span> </span><span> </span>@FileDetails FileDetailsType readonly<br />
)<br />
as</p>
<p class="MsoNormal"><span> </span>insert<br />
<span> </span>into<span> </span>FileDetails (FileName, CreatedDate, Size)<br />
<span> </span>select FileName, CreatedDate, Size<br />
<span> </span>from<span> </span>@FileDetails;</p></blockquote>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">Then to execute this procedure, we can create a data table and add the rows in to it. And then pass this data table as parameter to the database.</p>
<blockquote>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'; color: blue">private</span><span style="font-size: 10pt; font-family: 'Courier New'"> <span style="color: blue">static</span> <span style="color: blue">void</span> SaveFileDetail(<span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">FileInfo</span>&gt; info)</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&#8220;**********updating with tablevalued parameters****&#8221;</span>);</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">DataTable</span> dt = preparedatatable();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: blue">foreach</span> (<span style="color: #2b91af">FileInfo</span> file <span style="color: blue">in</span> info)</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">DataRow</span> dr = dt.NewRow();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span> </span>dr[0] = file.Name;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>dr[1] = file.CreationTime.ToShortDateString();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>dr[2] = (<span style="color: blue">decimal</span>)file.Length;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>dt.Rows.Add(dr);<span> </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: blue">using</span> (<span style="color: #2b91af">SqlConnection</span> conn = <span style="color: blue">new</span> <span style="color: #2b91af">SqlConnection</span>(<span style="color: #a31515">&#8220;your connection string&#8221;</span>))</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">SqlCommand</span> cmd = conn.CreateCommand();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>cmd.CommandType = System.Data.<span style="color: #2b91af">CommandType</span>.StoredProcedure;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>cmd.CommandText = <span style="color: #a31515">&#8220;dbo.InsertFileDetails&#8221;</span>;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">SqlParameter</span> param = cmd.Parameters.AddWithValue(<span style="color: #a31515">&#8220;@FileDetails&#8221;</span>, dt);<span> </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>conn.Open();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>cmd.ExecuteNonQuery();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&#8220;Completed Updating the database&#8221;</span>);</span><span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New'"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New'"><span> </span>}</span></p>
</blockquote>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New'"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New'">Now that’s cool isn’t it????</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><strong><a title="source code" href="http://www.aneef.net/wp-content/uploads/2007/12/tblvalueparam.zip" target="_blank">Download the code </a></strong></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=11&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2007/12/23/sql-server-2008-table-valued-parameters/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
