<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Madhav Joshi</title>
	<atom:link href="http://madhav.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://madhav.wordpress.com</link>
	<description>Keep your self alive. You don&#039;t know when you get chance</description>
	<lastBuildDate>Wed, 21 Sep 2011 11:59:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='madhav.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Madhav Joshi</title>
		<link>http://madhav.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://madhav.wordpress.com/osd.xml" title="Madhav Joshi" />
	<atom:link rel='hub' href='http://madhav.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Good Learning Links</title>
		<link>http://madhav.wordpress.com/2011/07/06/good-learning-links/</link>
		<comments>http://madhav.wordpress.com/2011/07/06/good-learning-links/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 01:42:27 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=90</guid>
		<description><![CDATA[Page Life Cycle<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=90&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx" title="ASP.NET Page Life Cycle">Page Life Cycle</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=90&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2011/07/06/good-learning-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>Speed up Linq to Sql with compiled queries</title>
		<link>http://madhav.wordpress.com/2011/07/06/speed-up-linq-to-sql-with-compiled-queries/</link>
		<comments>http://madhav.wordpress.com/2011/07/06/speed-up-linq-to-sql-with-compiled-queries/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 01:16:24 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=86</guid>
		<description><![CDATA[There is no doubt that tehre are some drawbacks to Linq to Sql. One of them is that the Sql statement is built dynamically so it is needed to be parsed and compiled each time you run it. Fortunately .Net 3.5 has a solution for this problem. System.Data.Linq namespace includes a class named CompiledQuery which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=86&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is no doubt that tehre are some drawbacks to Linq to Sql. One of them is that the Sql statement is built dynamically so it is needed to be parsed and compiled each time you run it. Fortunately .Net 3.5 has a solution for this problem. System.Data.Linq namespace includes a class named CompiledQuery which is responsible for caching the compiled version of a Linq to Sql query. This class has a static method called Compile which takes a Func&lt;T,S,R&gt; delegate. In this signature, T is the type of a DataContext (i.e. HRMDataContext) , S is the type of a predicate to filter the query and R is the type of returned result. Needless to say that it must be IQueryable&lt;T&gt;.</p>
<p>In this article we will see how to pre-compile a query, its limitations and how it really improves the speed of a Linq query.</p>
<p>To pre-compile a query we must define a public static field of type Func&lt;T,S,R&gt; . What we assign to this field is the result of CompiledQuery.Compile method:</p>
<p>public static Func&lt;testDataContext , SearchCriteria, IQueryable&lt;Person&gt;&gt; FilteredResult …</p>
<p>In the above line, testDataContex is the type of a DataContext inside the project, SearchCriteria is type of a class or struct that is designed for passing search criteria to .Compile method. For example, suppose that in testDataContext, we have a Table named Person. We have also defined a class (or struct) named SearchCriteria as bellow:</p>
<p>public class SearchCriteria<br />
{<br />
public int id { set; get; }<br />
public string FirstName { set; get; }<br />
public string LastName { set; get; }<br />
}</p>
<p>Now to get these definitions to work with a precompiled query we can write such a statement:</p>
<p>public static Func&lt;testDataContext , SearchCriteria, IQueryable&lt;Person&gt;&gt; FilteredResult =<br />
System.Data.Linq.CompiledQuery.Compile(<br />
(testDataContext dc , SearchCriteria criteria ) =&gt;<br />
from p in dc.Persons<br />
where (p.id == criteria.id || criteria.id == -1)<br />
&amp;&amp; (p.FirstName == criteria.FirstName || criteria.FirstName == string.Empty)<br />
&amp;&amp; (p.LastName == criteria.LastName || criteria.LastName == string.Empty)<br />
select p<br />
);</p>
<p>That’s it. At this point, FilteredResult contains a pre-compiled query and can be used this way:</p>
<p>testDataContext dc = new testDataContext();<br />
SearchCriteria criteria = new SearchCriteria();<br />
criteria.id = -1;<br />
criteria.FirstName = “Bill”;<br />
criteria.LastName = “Gates”;<br />
List&lt;Person&gt; p = FilteredResult(dc, criteria).ToList();</p>
<p>The above code creates instances of testDataContext (dc) and SearchCriteria (criteria) and passes them to FilteredResult as arguments. The result of FilteredResult is IQueryable&lt;Person&gt; we have called .ToList() extension method to get a List&lt;Person&gt; series.</p>
<p>One upsetting point about pre-compiled queries is that you can not use a stored-procedure to make a compiled query. In the above Linq to Sql code, if you write “from C in usp_GetPerson() …” you will get an error indicating that stored procedures are not allowed to be used.</p>
<p>Now let’s see how much precompilation can be helpful. I have written a small Console application that runs two version (one is compiled and one is not) of a query over a database for 1000 times. The time needed to run each query is as follows:</p>
<p>Compiled query takes 0 minutes, 1 seconds and 62 milliseconds.</p>
<p>Regular query takes 0 minutes, 13 seconds and 328 milliseconds.</p>
<p>As it is clear, the compiled query is greatly faster than a regular query. Notice that in a Linq model, nothing will really happen unless we iterate over the result of the query. Therefore, I have written a foreach statement to iterate over the result of queries. I also have written a small query at the beginning of the program to make Linq manager open a connection to Sql Server. If we do not do this, the compiled query will surprisingly takes longer!</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Data.Linq;</p>
<p>namespace CompiledQuery<br />
{<br />
class Program<br />
{<br />
public static Func&lt;testDataContext , SearchCriteria, IQueryable&lt;Person&gt;&gt; FilteredResult =<br />
System.Data.Linq.CompiledQuery.Compile(<br />
(testDataContext dc , SearchCriteria criteria ) =&gt;<br />
from p in dc.Persons<br />
where (p.id == criteria.id || criteria.id == -1)<br />
&amp;&amp; (p.FirstName == criteria.FirstName || criteria.FirstName == string.Empty)<br />
&amp;&amp; (p.LastName == criteria.LastName || criteria.LastName == string.Empty)<br />
select p<br />
);</p>
<p>static void Main(string[] args)<br />
{<br />
testDataContext dc = new testDataContext();<br />
SearchCriteria criteria = new SearchCriteria();<br />
IQueryable&lt;Person&gt; Q = null;</p>
<p>// The following code makes Linq manager to open a connection to Sql Server<br />
var init = from p in dc.Persons select p;<br />
foreach (Person person in init) ;</p>
<p>criteria.id = -1;<br />
criteria.FirstName = “Bill”;<br />
criteria.LastName = “Gates”;<br />
DateTime BeginTime = DateTime.Now;</p>
<p>for (int i = 0; i &lt; 1000; i++)<br />
{<br />
Q = FilteredResult(dc, criteria);<br />
foreach (Person person in Q) ;<br />
}</p>
<p>DateTime EndTime = DateTime.Now;<br />
TimeSpan Diff1 = EndTime – BeginTime;</p>
<p>BeginTime = DateTime.Now;</p>
<p>for (int i = 0; i &lt; 1000; i++)<br />
{<br />
Q = from p in dc.Persons<br />
where (p.id == criteria.id || criteria.id == -1)<br />
&amp;&amp; (p.FirstName == criteria.FirstName || criteria.FirstName == string.Empty)<br />
&amp;&amp; (p.LastName == criteria.LastName || criteria.LastName == string.Empty)<br />
select p;<br />
foreach (Person person in Q) ;<br />
}</p>
<p>EndTime = DateTime.Now;<br />
TimeSpan Diff2 = EndTime – BeginTime;</p>
<p>Console.WriteLine(“Compiled query takes : {0}:{1}:{2}”, Diff1.Minutes, Diff1.Seconds, Diff1.Milliseconds);<br />
Console.WriteLine(“Regular query takes {0}:{1}:{2}”, Diff2.Minutes, Diff2.Seconds, Diff2.Milliseconds);</p>
<p>Console.ReadKey();<br />
}<br />
}<br />
}</p>
<p>You can download the source of of a full sample project from <a href="http://www.filedony.com/fileupload/download.php?file=6d65666cd7ade8b98da2456521b6d72e" target="_blank">here</a>.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>In the earlier posts on LINQ to SQL performance optimization, I discussed about the <a href="http://www.a2zmenu.com/LINQ/LINQ%20to%20SQL%20Best%20Practice.aspx" target="_self">LINQ Best Practices</a><strong> </strong>and LINQ <a href="http://www.a2zmenu.com/LINQ/LINQ%20to%20SQL%20DataLoadOptions.aspx" target="_self">DataLoadOptions</a>. This discussion will remain incomplete if I donâ€™t included <strong>CompiledQuery.Compile</strong>.</p>
<p>While developing the application we often come across scenario where we are required to execute a similar nature of query more than couple of times.</p>
<p>When we execute a query using LINQ there are number of steps involved before final SQL query is generated, and each time we call the method to fetch the data whole process starting from query  generation to its execution is carried out. In this life cycle the overhead that is easily visible is that we are every time generating the query.</p>
<p>LINQâ€™s CompiledQuery.Compile is used to avoid this extra overhead. If you have a application executing structurally similar query, CompiledQuery.Compile is one thing that can help you increase the performance of your application.</p>
<p>CompiledQuery.Compile compiles the query once and execute it for the rest of the time with different set of parameters.</p>
<p>// Method in which whole process of query generation and execution take place everytime</p>
<p>private static void CompiledQueryMethod(string orderID)</p>
<p>{</p>
<p>SampleDataContextDataContext db = new SampleDataContextDataContext();</p>
<p>var result = from c in db.Customers</p>
<p>join o in db.Orders on c.CustomerID equals o.CustomerID</p>
<p>where o.OrderID == orderID</p>
<p>select new { c };</p>
<p>}</p>
<p>In this case whole process of query generation to execution is carried out each time CompiledQueryMethod is called.</p>
<p>Now lets do the same using CompiledQuery.Compile way.</p>
<p>// This will compile the query and return a delegate that can be used to execute for diffferent</p>
<p>// set of parameters</p>
<p>public static Func&lt;SampleDataContextDataContext, int, IQueryable&lt;Customer&gt;&gt;</p>
<p>GenerateCompiledQuery = CompiledQuery.Compile((SampleDataContextDataContext db, int orderID) =&gt;</p>
<p>from c in db.Customers</p>
<p>join o in db.Orders on c.CustomerID equals o.CustomerID</p>
<p>where o.OrderID == orderID</p>
<p>select c);</p>
<p><span style="color:#008000;font-family:'Courier New';">The above method returns a delegate that can be cached and used several number of time just by changing the input parameter.</span></p>
<p>private static void CompiledQueryMethod(int orderID)</p>
<p>{</p>
<p>SampleDataContextDataContext db = new SampleDataContextDataContext();</p>
<p>var result = GenerateCompiledQuery(db,orderID);</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=86&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2011/07/06/speed-up-linq-to-sql-with-compiled-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>LINQ-to-SQL vs stored procedures?</title>
		<link>http://madhav.wordpress.com/2011/07/06/linq-to-sql-vs-stored-procedures/</link>
		<comments>http://madhav.wordpress.com/2011/07/06/linq-to-sql-vs-stored-procedures/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 01:12:36 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=83</guid>
		<description><![CDATA[Some advantages of LINQ over sprocs: Type safety: I think we all understand this. Abstraction: This is especially true with LINQ-to-Entities. This abstraction also allows the framework to add additional improvements that you can easily take advantage of. PLINQ is an example of adding multi-threading support to LINQ. Code changes are minimal to add this support. It would [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=83&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some advantages of LINQ over sprocs:</p>
<ol>
<li><strong>Type safety</strong>: I think we all understand this.</li>
<li><strong>Abstraction</strong>: This is especially true with <a href="http://msdn.microsoft.com/en-us/library/bb386964.aspx" rel="nofollow">LINQ-to-Entities</a>. This abstraction also allows the framework to add additional improvements that you can easily take advantage of. <a href="http://msdn.microsoft.com/en-us/magazine/cc163329.aspx" rel="nofollow">PLINQ</a> is an example of adding multi-threading support to LINQ. Code changes are minimal to add this support. It would be MUCH harder to do this data access code that simply calls sprocs.</li>
<li><strong>Debugging support</strong>: I can use any .NET debugger to debug the queries. With sprocs, you cannot easily debug the SQL and that experience is largely tied to your database vendor (MS SQL Server provides a query analyzer, but often that isn&#8217;t enough).</li>
<li><strong>Vendor agnostic</strong>: LINQ works with lots of databases and the number of supported databases will only increase. Sprocs are not always portable between databases, either because of varying syntax or feature support (if the database supports sprocs at all).</li>
<li><strong>Deployment</strong>: Others have mentioned this already, but it&#8217;s easier to deploy a single assembly than to deploy a set of sprocs. This also ties in with #4.</li>
<li><strong>Easier</strong>: You don&#8217;t have to learn T-SQL to do data access, nor do you have to learn the data access API (e.g. ADO.NET) necessary for calling the sprocs. This is related to #3 and #4.</li>
</ol>
<p>Some disadvantages of LINQ vs sprocs:</p>
<ol>
<li><strong>Network traffic</strong>: sprocs need only serialize sproc-name and argument data over the wire while LINQ sends the entire query. This can get really bad if the queries are very complex. However, LINQ&#8217;s abstraction allows Microsoft to improve this over time.</li>
<li><strong>Less flexible</strong>: Sprocs can take full advantage of a database&#8217;s featureset. LINQ tends to be more generic in it&#8217;s support. This is common in any kind of language abstraction (e.g. C# vs assembler).</li>
<li><strong>Recompiling</strong>: If you need to make changes to the way you do data access, you need to recompile, version, and redeploy your assembly. Sprocs can <em>sometimes</em> allow a DBA to tune the data access routine without a need to redeploy anything.</li>
</ol>
<p>Security and manageability are something that people argue about too.</p>
<ol>
<li><strong>Security</strong>: For example, you can protect your sensitive data by restricting access to the tables directly, and put ACLs on the sprocs. With LINQ, however, you can still restrict direct access to tables and instead put ACLs on updatable table <em>views</em> to achieve a similar end (assuming your database supports updatable views).</li>
<li><strong>Manageability</strong>: Using views also gives you the advantage of shielding your application non-breaking from schema changes (like table normalization). You can update the view without requiring your data access code to change.</li>
</ol>
<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>
<p>LINQ should be close in performance but I disagree with the statement above that says LINQ is faster, it can&#8217;t be faster, it could possibly be just as as fast though, all other things being equal.</p>
<p>I think the difference is that a good SQL developer, who knows how to optimize, and uses stored procedures is always going to have a slight edge in performance. If you are not strong on SQL, let Linq figure it out for you, and your performance is most likely going to be acceptable. If you are a strong SQL developer, use stored procedures to squeeze out a bit of extra performance if you app requires it.</p>
<p>It certainly is possible if you write terrible SQL to code up some stored procedures that execute slower than Linq would, but if you know what you are doing, stored procedures and a Datareader can&#8217;t be beat.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=83&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2011/07/06/linq-to-sql-vs-stored-procedures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>Out Parameter in Oracle Stored Proc</title>
		<link>http://madhav.wordpress.com/2011/06/07/out-parameter-in-oracle-stored-proc/</link>
		<comments>http://madhav.wordpress.com/2011/06/07/out-parameter-in-oracle-stored-proc/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 15:09:05 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=78</guid>
		<description><![CDATA[public static int Merge(Issuer IssuerData) { DataRequest oRequest = new DataRequest(&#8220;PKG_NAME.ProcName&#8221;); oRequest.CommandType = CommandType.StoredProcedure; oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam1&#8243;, IssuerData.IssuerCode)); oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam2&#8243;, IssuerData.IssuerName)); oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam3&#8243;, IssuerData.NonVotingShares.ToString())); oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_CRDT_RPT_DT&#8221;, IssuerData.CreditReportDate.HasValue?IssuerData.CreditReportDate.Value.ToString(&#8220;dd-MMM-yy&#8221;):&#8221;" )); OracleParameter outParam = new OracleParameter(&#8220;p_NUM_RECS_AFFECTED&#8221;, OracleDbType.Decimal, ParameterDirection.Output); oRequest.Parameters.Add(outParam); ORADataFactory oFactory = new ORADataFactory(); oFactory.ExecuteNonQuery(oRequest); int numRecsAffected = 0; int.TryParse(outParam.Value.ToString(), out numRecsAffected); return numRecsAffected; }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=78&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>  public static int Merge(Issuer IssuerData)<br />
        {<br />
            DataRequest oRequest = new DataRequest(&#8220;PKG_NAME.ProcName&#8221;);<br />
            oRequest.CommandType = CommandType.StoredProcedure;<br />
            oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam1&#8243;, IssuerData.IssuerCode));<br />
            oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam2&#8243;, IssuerData.IssuerName));<br />
            oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_InParam3&#8243;, IssuerData.NonVotingShares.ToString()));<br />
            oRequest.Parameters.Add(new DataRequest.Parameter(&#8220;p_CRDT_RPT_DT&#8221;, IssuerData.CreditReportDate.HasValue?IssuerData.CreditReportDate.Value.ToString(&#8220;dd-MMM-yy&#8221;):&#8221;" ));</p>
<p>            OracleParameter outParam = new OracleParameter(&#8220;p_NUM_RECS_AFFECTED&#8221;, OracleDbType.Decimal, ParameterDirection.Output);<br />
            oRequest.Parameters.Add(outParam);</p>
<p>            ORADataFactory oFactory = new ORADataFactory();<br />
            oFactory.ExecuteNonQuery(oRequest);</p>
<p>            int numRecsAffected = 0;<br />
            int.TryParse(outParam.Value.ToString(), out numRecsAffected);</p>
<p>            return numRecsAffected;<br />
        }</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=78&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2011/06/07/out-parameter-in-oracle-stored-proc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>Execute Stored Proc in TOAD</title>
		<link>http://madhav.wordpress.com/2011/06/07/execute-stored-proc-in-toad/</link>
		<comments>http://madhav.wordpress.com/2011/06/07/execute-stored-proc-in-toad/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 15:01:35 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=76</guid>
		<description><![CDATA[DECLARE result_set INTEGER; BEGIN GAL.PKG_COUNTERPARTY.UI_COUNTERPARTY(0, 1, 1, &#8216;ABN&#8217;, &#8216;ULT P NAME&#8217;, 1, &#8216;USA&#8217;, &#8216;PUB SECURITY&#8217;, NULL, 1, &#8216;Y&#8217;, &#8216;Y&#8217;, &#8216;Y&#8217;, 1, &#8216;N&#8217;, 7, &#8216;GNM&#8217;, 1, SYSDATE, &#8216;SHORT SUM&#8217;, 1, &#8216;Y&#8217;, SYSDATE, SYSDATE, &#8216;SHORT SUM&#8217;, 1, &#8216;SHORT SUM&#8217;, SYSDATE, &#8216;Y&#8217;, &#8216;V_RSRCH_UNIT_CNTCT&#8217;, &#8216;V_SPNSR_UNIT_CNTCT&#8217;, &#8216;V_CRTS_CNTCT&#8217;, &#8216;V_XTRA_FIELD1&#8242;, &#8216;V_XTRA_FIELD2&#8242;, &#8216;V_XTRA_FIELD3 &#8216;, &#8216;V_XTRA_FIELD4 &#8216;, &#8216;V_XTRA_FIELD5 &#8216;, &#8216;SYSADMN&#8217;, SYSDATE, result_set); dbms_output.put_line(&#8216;cp id [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=76&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>DECLARE<br />
result_set INTEGER;<br />
BEGIN<br />
GAL.PKG_COUNTERPARTY.UI_COUNTERPARTY(0,    1,<br />
    1,    &#8216;ABN&#8217;,    &#8216;ULT P NAME&#8217;,    1,    &#8216;USA&#8217;,    &#8216;PUB SECURITY&#8217;,    NULL,    1,    &#8216;Y&#8217;,    &#8216;Y&#8217;,    &#8216;Y&#8217;,    1,    &#8216;N&#8217;,    7,<br />
    &#8216;GNM&#8217;,    1,    SYSDATE,    &#8216;SHORT SUM&#8217;,    1,    &#8216;Y&#8217;,<br />
    SYSDATE,    SYSDATE,    &#8216;SHORT SUM&#8217;,    1,    &#8216;SHORT SUM&#8217;,    SYSDATE,    &#8216;Y&#8217;,   &#8216;V_RSRCH_UNIT_CNTCT&#8217;,    &#8216;V_SPNSR_UNIT_CNTCT&#8217;,<br />
    &#8216;V_CRTS_CNTCT&#8217;,    &#8216;V_XTRA_FIELD1&#8242;,    &#8216;V_XTRA_FIELD2&#8242;,    &#8216;V_XTRA_FIELD3 &#8216;,    &#8216;V_XTRA_FIELD4 &#8216;,    &#8216;V_XTRA_FIELD5 &#8216;,   &#8216;SYSADMN&#8217;,    SYSDATE,<br />
    result_set);<br />
    dbms_output.put_line(&#8216;cp id : &#8216; || result_set);<br />
END; </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-Ref Cursor &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
DECLARE<br />
type result_set is ref cursor;<br />
BEGIN<br />
SK_CORAL.STAT_CERTIFICATE_PKG.GENERATENONNAICSUSPANCE(&#8217;31-OCT-2010&#8242;,:result_set);<br />
END; </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=76&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2011/06/07/execute-stored-proc-in-toad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>WAAS</title>
		<link>http://madhav.wordpress.com/2010/11/30/waas/</link>
		<comments>http://madhav.wordpress.com/2010/11/30/waas/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 16:42:33 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
				<category><![CDATA[WAAS IN GPS]]></category>

		<guid isPermaLink="false">http://madhav.wordpress.com/?p=66</guid>
		<description><![CDATA[WAAS (Wide Area Augmentation System) was developed by the Federal Aviation Administration to augment the Global Positioning System to improve its accuracy, integrity, and availability. WAAS was originally intended to enable aircraft to rely on GPS for all phases of flight, including the precision approach to airport&#8217;s within its coverage area. The WAAS system typically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=66&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WAAS (Wide Area Augmentation System) was developed by the Federal Aviation Administration to augment the Global Positioning System to improve its accuracy, integrity, and availability. WAAS was originally intended to enable aircraft to rely on GPS for all phases of flight, including the precision approach to airport&#8217;s within its coverage area. The WAAS system typically provides better than 1.0 meters laterally and 1.5 meters vertically throughout most of the contiguous United States and large parts of Canada and Alaska. This accuracy is capable of provideing aircraft with the precision needed for safe approaches and inflight navigation for all weather conditions. Integrity of the WAAS information is no more than 3 seconds of bad data per year allowing the system to be considerd safe by the FAA for instrument flight rules.</p>
<p>Although orignally developed for aviation, WAAS is not just limited to the aviation industry, any GPS receiver that is capable of receiving the WAAS signal will be able to benefit from it&#8217;s correction data, making the GPS positioning more accurate. In fact a WAAS-enabled GPS receiver can even give you directions right down to the lane your car is traveling in (as long as the maping program supports &#8220;lane assist&#8221; directions). Because the Wide Area Augmentation System is quickly becoming standard in the GPS industry, most new GPS receivers today are WAAS-enabled. Just like with the conventinal GPS, the WAAS system doesn&#8217;t come with any extra cost or fees to use. All that is required is that the GPS receiver be WAAS-enabled so it can receive and decode the data then be able to apply corrections to it&#8217;s position. Currently the WAAS service is limited to the U.S.A., Canada, Alaska and Hawaii. Although independant from WAAS, Europe and Asia are working on their own supplemental GPS correction systems. Europe has the  &#8220;Euro Geostationary Navigation Overlay Service&#8221; (EGNOS) and Japan is working on their &#8220;Multi-Functional Satellite Augmentation System&#8221; (MSAS) .</p>
<p>How The WAAS System Works</p>
<p>WAAS uses a network of approximately 25 ground based Wide-area Reference Stations (WRS) in North America and Hawaii, to measure small variations in GPS satellite signals in the western hemisphere. These precisely surveyed ground stations monitor and collect information on the GPS signals and send their data to the three Wide-area Master Stations (WMS). The WMS&#8217;s generate two different sets of corrections: fast and slow. The fast corrections are for errors that are changing rapidly and are a primary concern to the GPS satellites instantaneous positions and clock errors. These corrections are user position independent, which means they can be applied instantly by any receiver in the WAAS broadcasting area. The slow corrections are for long-term ephemeric and clock error estimates and ionospheric delay information.</p>
<p>Once these corrections are generated, the Master Stations sends them to two pairs of Ground Uplink Stations (GUS) that transmit the correction messages to a series of geostationary satellites that broadcast their correction data back to earth. Then WAAS-enabled GPS receivers use this information to make corrections to the original GPS signial, giving WAAS-enabled GPS receiver a more accurate position. GPS receiver&#8217;s use the information broadcast from each GPS satellite to determine their location and the current time. Depending on the GPS device, a GPS receiver only needs to receive a signal from 3-4 satellites (out of the 31 satellites currently transmiting a signal for civilan users) to be able to calculate it&#8217;s position. In addition to the GPS signal, a WAAS-enabled GPS receiver can also receive the geostationary WAAS satellite signal.</p>
<p>The two different types of correction messages from the WAAS system (fast and slow) are used by  the GPS receiver in different ways. The fast type of correction data includes the corrected satellite position and clock data to determine its current location using normal GPS calculations. Once an approximate position fix is obtained the GPS receiver begins to use the slow corrections to improve its accuracy. Slow correction data Includes the ionospheric delay. When the GPS signal travels from the satellite to the receiver, it passes through the ionosphere. The receiver calculates the location where the signal pierced the ionosphere and, if it has received an ionospheric delay value for that location, it corrects for the error  that the ionosphere created. Unlike the fast data, the slow data doesn&#8217;t need to be updated frequently because the ionosphere conditions don&#8217;t change rapidly. While the slow data can be updated every minute if necessary, they are only updated every two minutes and are considered valid for up to six minutes.</p>
<p>Limitations of the WAAS System</p>
<p>(1) The WAAS system is currently only available to United States and large parts of Canada and Alaska but there plans to expand the system to other countries and continents.</p>
<p>(2) Because the WAAS broadcasting satellites are geostationary  causes them to be less than 10° above the horizon for locations north of 71.4° latitude. This means aircraft in areas of Alaska or northern Canada may have difficulty maintaining a lock on the WAAS signal.</p>
<p>(3) In order to calculate an ionospheric grid point&#8217;s delay, that point must be located between a satellite and a reference station. The low number of satellites and ground stations limit the number of points which can be calculated.</p>
<p>(4) Aircraft conducting WAAS approaches must possess certified GPS receivers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=66&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2010/11/30/waas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>RefCursor</title>
		<link>http://madhav.wordpress.com/2010/10/29/refcursor/</link>
		<comments>http://madhav.wordpress.com/2010/10/29/refcursor/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 18:15:14 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
				<category><![CDATA[RefCursor]]></category>

		<guid isPermaLink="false">http://madhav.wordpress.com/?p=61</guid>
		<description><![CDATA[Execute Ref Cursor in oracle (PL/SQL) SQL&#62; variable P_REFCURSOR REFCURSOR; SQL&#62; execute SK_CORAL.BSCBUCKET_PKG.GETBSCCOMBODETAIL ( &#8217;30-Sep-2010&#8242;, _REFCURSOR); PL/SQL procedure successfully completed. SQL&#62; PRINT P_REFCURSOR; ref_cursors Strongly Typed Note: A REF CURSOR that specifies a specific return type. Package Header CREATE OR REPLACE PACKAGE strongly_typed IS TYPE return_cur IS REF CURSOR RETURN all_tables%ROWTYPE; PROCEDURE child(p_return_rec OUT return_cur); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=61&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Execute Ref Cursor in oracle (PL/SQL)</strong><br />
SQL&gt; variable P_REFCURSOR REFCURSOR;<br />
SQL&gt; execute SK_CORAL.BSCBUCKET_PKG.GETBSCCOMBODETAIL ( &#8217;30-Sep-2010&#8242;, <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> _REFCURSOR);<br />
PL/SQL procedure successfully completed.<br />
SQL&gt; PRINT P_REFCURSOR;</p>
<p><a href="http://psoug.org/reference/ref_cursors.html">ref_cursors</a></p>
<p>Strongly Typed<br />
Note: A REF CURSOR that specifies a specific return type.</p>
<p>Package Header 	CREATE OR REPLACE PACKAGE strongly_typed IS</p>
<p>TYPE return_cur IS REF CURSOR RETURN all_tables%ROWTYPE;<br />
PROCEDURE child(p_return_rec OUT return_cur);<br />
PROCEDURE parent(p_NumRecs PLS_INTEGER);</p>
<p>END strongly_typed;<br />
/</p>
<p>Package Body 	CREATE OR REPLACE PACKAGE BODY strongly_typed IS<br />
PROCEDURE child(p_return_rec OUT return_cur) IS</p>
<p>BEGIN<br />
  OPEN p_return_rec FOR<br />
  SELECT * FROM all_tables;<br />
END child;<br />
&#8211;==================================================<br />
PROCEDURE parent (p_NumRecs PLS_INTEGER) IS<br />
 p_retcur return_cur;<br />
 at_rec   all_tables%ROWTYPE;<br />
BEGIN<br />
  child(p_retcur);</p>
<p>  FOR i IN 1 .. p_NumRecs<br />
  LOOP<br />
    FETCH p_retcur<br />
    INTO at_rec;</p>
<p>    dbms_output.put_line(at_rec.table_name ||<br />
    &#8216; &#8211; &#8216; || at_rec.tablespace_name ||<br />
    &#8216; &#8211; &#8216; || TO_CHAR(at_rec.initial_extent) ||<br />
    &#8216; &#8211; &#8216; || TO_CHAR(at_rec.next_extent));<br />
  END LOOP;<br />
END parent;<br />
END strongly_typed;<br />
/<br />
To Run The Demo 	set serveroutput on</p>
<p>exec strongly_typed.parent(1)<br />
exec strongly_typed.parent(8)</p>
<p>Weakly Typed<br />
Note: A REF CURSOR that does not specify the return type such as SYS_REFCURSOR.</p>
<p>Child Procedure 	CREATE OR REPLACE PROCEDURE child (<br />
 p_NumRecs IN PLS_INTEGER,<br />
 p_return_cur OUT SYS_REFCURSOR)<br />
IS</p>
<p>BEGIN<br />
  OPEN p_return_cur FOR<br />
  &#8216;SELECT * FROM all_tables WHERE rownum &lt;= &#039; || p_NumRecs ;<br />
END child;<br />
/</p>
<p>Parent Procedure 	CREATE OR REPLACE PROCEDURE parent (pNumRecs VARCHAR2) IS<br />
 p_retcur  SYS_REFCURSOR;<br />
 at_rec    all_tables%ROWTYPE;<br />
BEGIN<br />
  child(pNumRecs, p_retcur);</p>
<p>  FOR i IN 1 .. pNumRecs<br />
  LOOP<br />
    FETCH p_retcur<br />
    INTO at_rec;</p>
<p>    dbms_output.put_line(at_rec.table_name ||<br />
    &#039; &#8211; &#039; || at_rec.tablespace_name ||<br />
    &#039; &#8211; &#039; || TO_CHAR(at_rec.initial_extent) ||<br />
    &#039; &#8211; &#039; || TO_CHAR(at_rec.next_extent));<br />
  END LOOP;<br />
END parent;<br />
/<br />
To Run The Demo 	set serveroutput on</p>
<p>exec parent(1)<br />
exec parent(17)</p>
<p>Passing Ref Cursors</p>
<p>Ref Cursor Passing Demo 	CREATE TABLE employees (<br />
empid   NUMBER(5),<br />
empname VARCHAR2(30));</p>
<p>INSERT INTO employees (empid, empname) VALUES (1, &#039;Dan Morgan&#039;);<br />
INSERT INTO employees (empid, empname) VALUES (2, &#039;Hans Forbrich&#039;);<br />
INSERT INTO employees (empid, empname) VALUES (3, &#039;Caleb Small&#039;);<br />
COMMIT;<br />
CREATE OR REPLACE PROCEDURE pass_ref_cur(p_cursor SYS_REFCURSOR) IS</p>
<p>TYPE array_t IS TABLE OF VARCHAR2(4000)<br />
INDEX BY BINARY_INTEGER;</p>
<p>rec_array array_t;</p>
<p>BEGIN<br />
  FETCH p_cursor BULK COLLECT INTO rec_array;</p>
<p>  FOR i IN rec_array.FIRST .. rec_array.LAST<br />
  LOOP<br />
    dbms_output.put_line(rec_array(i));<br />
  END LOOP;<br />
END pass_ref_cur;<br />
/</p>
<p>set serveroutput on</p>
<p>DECLARE<br />
 rec_array SYS_REFCURSOR;<br />
BEGIN<br />
  OPEN rec_array FOR<br />
  &#039;SELECT empname FROM employees&#039;;</p>
<p>  pass_ref_cur(rec_array);<br />
  CLOSE rec_array;<br />
END;<br />
/</p>
<p>Introduction to REF CURSOR</p>
<p>A REF CURSOR is basically a data type.  A variable created based on such a data type is generally called a cursor variable.  A cursor variable can be associated with different queries at run-time.  The primary advantage of using cursor variables is their capability to pass result sets between sub programs (like stored procedures, functions, packages etc.).</p>
<p>Let us start with a small sub-program as follows:</p>
<p>declare<br />
  type r_cursor is REF CURSOR;<br />
  c_emp r_cursor;<br />
  en emp.ename%type;<br />
begin<br />
  open c_emp for select ename from emp;<br />
  loop<br />
      fetch c_emp into en;<br />
      exit when c_emp%notfound;<br />
      dbms_output.put_line(en);<br />
  end loop;<br />
  close c_emp;<br />
end;</p>
<p>Let me explain step by step.  The following is the first statement you need to understand:</p>
<p>  type r_cursor is REF CURSOR;</p>
<p>The above statement simply defines a new data type called &quot;r_cursor,&quot; which is of the type REF CURSOR.  We declare a cursor variable named &quot;c_emp&quot; based on the type &quot;r_cursor&quot; as follows:</p>
<p>  c_emp r_cursor;</p>
<p>Every cursor variable must be opened with an associated SELECT statement as follows:</p>
<p>  open c_emp for select ename from emp;</p>
<p>To retrieve each row of information from the cursor, I used a loop together with a FETCH statement as follows:</p>
<p>  loop<br />
      fetch c_emp into en;<br />
      exit when c_emp%notfound;<br />
      dbms_output.put_line(en);<br />
  end loop;</p>
<p>I finally closed the cursor using the following statement:</p>
<p>  close c_emp;</p>
<p>%ROWTYPE with REF CURSOR</p>
<p>In the previous section, I retrieved only one column (ename) of information using REF CURSOR.  Now I would like to retrieve more than one column (or entire row) of information using the same.  Let us consider the following example:</p>
<p>declare<br />
  type r_cursor is REF CURSOR;<br />
  c_emp r_cursor;<br />
  er emp%rowtype;<br />
begin<br />
  open c_emp for select * from emp;<br />
  loop<br />
      fetch c_emp into er;<br />
      exit when c_emp%notfound;<br />
      dbms_output.put_line(er.ename || &#039; &#8211; &#039; || er.sal);<br />
  end loop;<br />
  close c_emp;<br />
end;</p>
<p>In the above example, the only crucial declaration is the following:</p>
<p>  er emp%rowtype;</p>
<p>The above declares a variable named &quot;er,&quot; which can hold an entire row from the &quot;emp&quot; table.  To retrieve the values (of each column) from that variable, we use the dot notation as follows:</p>
<p>      dbms_output.put_line(er.ename || &#039; &#8211; &#039; || er.sal);</p>
<p>Let us consider that a table contains forty columns and I would like to retrieve fifteen columns.  In such scenarios, it is a bad idea to retrieve all forty columns of information.  At the same time, declaring and working with fifteen variables would be bit clumsy.  The next section will explain how to solve such issues.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=61&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2010/10/29/refcursor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>Merge in Oracle</title>
		<link>http://madhav.wordpress.com/2010/09/29/merge-in-oracle/</link>
		<comments>http://madhav.wordpress.com/2010/09/29/merge-in-oracle/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 18:50:24 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://madhav.wordpress.com/2010/09/29/merge-in-oracle/</guid>
		<description><![CDATA[SQL&#62; MERGE 2 INTO target_table tgt 3 USING source_table src 4 ON ( src.object_id = tgt.object_id ) 5 WHEN MATCHED 6 THEN 7 UPDATE 8 SET tgt.object_name = src.object_name 9 , tgt.object_type = src.object_type 10 WHEN NOT MATCHED 11 THEN 12 INSERT ( tgt.object_id 13 , tgt.object_name 14 , tgt.object_type ) 15 VALUES ( src.object_id [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=58&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SQL&gt; MERGE<br />
  2     INTO  target_table tgt<br />
  3     USING source_table src<br />
  4     ON  ( src.object_id = tgt.object_id )<br />
  5  WHEN MATCHED<br />
  6  THEN<br />
  7     UPDATE<br />
  8     SET   tgt.object_name = src.object_name<br />
  9     ,     tgt.object_type = src.object_type<br />
 10  WHEN NOT MATCHED<br />
 11  THEN<br />
 12     INSERT ( tgt.object_id<br />
 13            , tgt.object_name<br />
 14            , tgt.object_type )<br />
 15     VALUES ( src.object_id<br />
 16            , src.object_name<br />
 17            , src.object_type );</p>
<p>MERGE  INTO table<br />
USING table<br />
ON ()<br />
WHEN MATCHED THEN<br />
DELETE<br />
WHEN NOT MATCHED THEN<br />
[LOG ERRORS  &lt;reject limit ];</p>
<p>CREATE TABLE employee (<br />
employee_id NUMBER(5),<br />
first_name  VARCHAR2(20),<br />
last_name   VARCHAR2(20),<br />
dept_no     NUMBER(2),<br />
salary      NUMBER(10));</p>
<p>INSERT INTO employee VALUES (1, &#8216;Dan&#8217;, &#8216;Morgan&#8217;, 10, 100000);<br />
INSERT INTO employee VALUES (2, &#8216;Helen&#8217;, &#8216;Lofstrom&#8217;, 20, 100000);<br />
INSERT INTO employee VALUES (3, &#8216;Akiko&#8217;, &#8216;Toyota&#8217;, 20, 50000);<br />
INSERT INTO employee VALUES (4, &#8216;Jackie&#8217;, &#8216;Stough&#8217;, 20, 40000);<br />
INSERT INTO employee VALUES (5, &#8216;Richard&#8217;, &#8216;Foote&#8217;, 20, 70000);<br />
INSERT INTO employee VALUES (6, &#8216;Joe&#8217;, &#8216;Johnson&#8217;, 20, 30000);<br />
INSERT INTO employee VALUES (7, &#8216;Clark&#8217;, &#8216;Urling&#8217;, 20, 90000);</p>
<p>CREATE TABLE bonuses (<br />
employee_id NUMBER, bonus NUMBER DEFAULT 100);</p>
<p>INSERT INTO bonuses (employee_id) VALUES (1);<br />
INSERT INTO bonuses (employee_id) VALUES (2);<br />
INSERT INTO bonuses (employee_id) VALUES (4);<br />
INSERT INTO bonuses (employee_id) VALUES (6);<br />
INSERT INTO bonuses (employee_id) VALUES (7);<br />
COMMIT;</p>
<p>SELECT * FROM employee;</p>
<p>SELECT * FROM bonuses;</p>
<p>MERGE INTO bonuses b<br />
USING (<br />
  SELECT employee_id, salary, dept_no<br />
  FROM employee<br />
  WHERE dept_no =20) e<br />
ON (b.employee_id = e.employee_id)<br />
WHEN MATCHED THEN<br />
  UPDATE SET b.bonus = e.salary * 0.1<br />
  DELETE WHERE (e.salary  40000);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=58&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2010/09/29/merge-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>GoodSites</title>
		<link>http://madhav.wordpress.com/2010/08/25/goodsites/</link>
		<comments>http://madhav.wordpress.com/2010/08/25/goodsites/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 18:53:39 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
		
		<guid isPermaLink="false">http://madhav.wordpress.com/?p=53</guid>
		<description><![CDATA[For learning HTML, XML, JAVA Script and other w3schools.com Shivprashad Koirala Help Question Answer<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=53&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For learning HTML, XML, JAVA Script and other<br />
<a href="http://www.w3schools.com">w3schools.com</a><br />
<a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=1335831">Shivprashad Koirala Help Question Answer</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=53&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2010/08/25/goodsites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET</title>
		<link>http://madhav.wordpress.com/2010/07/24/landscape-saving-from-excel-to-pdf-in-asp-net/</link>
		<comments>http://madhav.wordpress.com/2010/07/24/landscape-saving-from-excel-to-pdf-in-asp-net/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 04:23:50 +0000</pubDate>
		<dc:creator>madhav</dc:creator>
				<category><![CDATA[Asp.Net Help]]></category>

		<guid isPermaLink="false">http://madhav.wordpress.com/?p=42</guid>
		<description><![CDATA[What is ASP.NET? ASP.NET is a compiled .NET-based environment, wherein the author can write applications in any .NET compatible language, including Visual Basic .NET, C#, and JavaScript. NET. Developers can easily access the benefits of these technologies, which include the managed common language runtime environment, type safety, inheritance, and so on. Landscape Saving from Excel [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=42&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><span style="font-family:'Trebuchet MS';font-weight:bold;text-decoration:underline;">What is ASP.NET?</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">ASP.NET is a compiled .NET-based environment, wherein the author can write applications in any .NET compatible language, including Visual Basic .NET, C#, and JavaScript.</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">NET. Developers can easily access the benefits of these technologies, which include the managed common language runtime environment, type safety, inheritance, and so on. </span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';font-weight:bold;text-decoration:underline;">Landscape Saving from Excel to PDF in ASP.NET</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">string sourceFilePath = Server.MapPath(&#8220;~/aaa.xlsx&#8221;);</span></div>
<div><span style="font-family:'Trebuchet MS';">string destinationFilePath = Server.MapPath(&#8220;~/aaa.pdf&#8221;);</span></div>
<div><span style="font-family:'Trebuchet MS';">Microsoft.Office.Interop.Excel.Application myExcelApp;</span></div>
<div><span style="font-family:'Trebuchet MS';">Microsoft.Office.Interop.Excel.Workbooks myExcelWorkbooks = null;</span></div>
<div><span style="font-family:'Trebuchet MS';">Microsoft.Office.Interop.Excel.Workbook myExcelWorkbook = null;</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">try</span></div>
<div><span style="font-family:'Trebuchet MS';">{</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">object misValue = System.Reflection.Missing.Value;</span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelApp.Visible = true;</span></div>
<div><span style="font-family:'Trebuchet MS';">object varMissing = Type.Missing;</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelWorkbooks = myExcelApp.Workbooks;</span></div>
<div><span style="font-family:'Trebuchet MS';">//if file already exist then delete the file</span></div>
<div><span style="font-family:'Trebuchet MS';">if (System.IO.File.Exists(destinationFilePath))</span></div>
<div><span style="font-family:'Trebuchet MS';">{</span></div>
<div><span style="font-family:'Trebuchet MS';">System.IO.File.Delete(destinationFilePath);</span></div>
<div><span style="font-family:'Trebuchet MS';">}</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelWorkbook = myExcelWorkbooks.Open(sourceFilePath, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue);</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelWorkbook.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF,</span></div>
<div><span style="font-family:'Trebuchet MS';">destinationFilePath, Microsoft.Office.Interop.Excel.XlFixedFormatQuality.xlQualityStandard,</span></div>
<div><span style="font-family:'Trebuchet MS';">varMissing, false, varMissing, varMissing, false, varMissing);</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelWorkbooks.Close();</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelApp.Quit();</span></div>
<div><span style="font-family:'Trebuchet MS';"><br />
    </span></div>
<div><span style="font-family:'Trebuchet MS';">}</span></div>
<div><span style="font-family:'Trebuchet MS';">catch</span></div>
<div><span style="font-family:'Trebuchet MS';">{</span></div>
<div><span style="font-family:'Trebuchet MS';">}</span></div>
<div><span style="font-family:'Trebuchet MS';">finally</span></div>
<div><span style="font-family:'Trebuchet MS';">{</span></div>
<div><span style="font-family:'Trebuchet MS';">myExcelApp = null;</span></div>
<div><span style="font-family:'Trebuchet MS';">}</span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/madhav.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/madhav.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/madhav.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=madhav.wordpress.com&amp;blog=238101&amp;post=42&amp;subd=madhav&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://madhav.wordpress.com/2010/07/24/landscape-saving-from-excel-to-pdf-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f781ec7b7dfcd346d94514d048fed9d2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">madhav</media:title>
		</media:content>
	</item>
	</channel>
</rss>
