<?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>Gazishaheen's Weblog</title>
	<atom:link href="http://gazishaheen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gazishaheen.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 23 Apr 2009 11:01:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gazishaheen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Gazishaheen's Weblog</title>
		<link>http://gazishaheen.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gazishaheen.wordpress.com/osd.xml" title="Gazishaheen&#039;s Weblog" />
	<atom:link rel='hub' href='http://gazishaheen.wordpress.com/?pushpress=hub'/>
		<item>
		<title>creating JavaScript libraries</title>
		<link>http://gazishaheen.wordpress.com/2009/03/16/creating-javascript-libraries/</link>
		<comments>http://gazishaheen.wordpress.com/2009/03/16/creating-javascript-libraries/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 13:09:28 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=21</guid>
		<description><![CDATA[Syntax for creating JavaScript libraries All JavaScript libraries consists of two parts: The external JavaScript itself, which is simply a text file with the containing JavaScript code, saved as a .js file. A &#60;script&#62; tag referencing the external JavaScript file and defined on the page(s) that uses the library. For the sake of our discussion, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=21&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><strong><span style="color:black;font-family:&quot;"><span style="font-size:small;">Syntax for creating JavaScript libraries</span></span></strong></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:black;font-family:&quot;">All JavaScript libraries consists of two parts:</span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">The external JavaScript itself, which is simply a text file with the containing JavaScript code, saved as a .js file.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">A &lt;script&gt; tag referencing the external JavaScript file and defined on the page(s) that uses the library.</span></li>
</ul>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:black;font-family:&quot;">For the sake of our discussion, let&#8217;s pretend you&#8217;ve just created a fabulous code that writes out today&#8217;s date:</span></p>
<p class="MsoNormal" style="background:#efefef;line-height:normal;margin:0;">
<pre class="brush: xml;">&lt;script type=”text/javascript”&gt;

function todaydate(){

var today_date= new Date()

var myyear=today_date.getYear()

var mymonth=today_date.getMonth()+1

var mytoday=today_date.getDate()

document.write(myyear+”/”+mymonth+”/”+mytoday)

}

&lt;/script&gt;
</pre>
</p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:black;font-family:&quot;">Using the above code, lets create a library out of it, so multiple pages can all display a nice date without having to physically include the above code on that page. </span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><strong><span style="font-size:10pt;color:black;font-family:&quot;">Step 1: </span></strong><span style="font-size:10pt;color:black;font-family:&quot;">Open up your text editor (such as notepad), type out the above code, and save it as an individual file with the extension</span><strong><span style="font-size:10pt;color:black;font-family:&quot;"> .js </span></strong><span style="font-size:10pt;color:black;font-family:&quot;">(ie: displaydate.js). </span><span style="font-size:10pt;color:black;font-family:&quot;">An external library should include the entire script, </span><strong><span style="font-size:10pt;color:red;font-family:&quot;">minus</span></strong><span style="font-size:10pt;color:black;font-family:&quot;"> the surrounding script tags.</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><strong><span style="font-size:10pt;color:black;font-family:&quot;">Step 2: </span></strong><span style="font-size:10pt;color:black;font-family:&quot;">On all pages that use the above library, create a reference to it by using the below code. It consist of a &lt;script&gt; tag with the optional src property included inside:</span></p>
<p class="MsoNormal" style="background:#efefef;line-height:normal;margin:0;"><span style="font-size:10pt;color:black;font-family:&quot;">&lt;script <strong>src=&#8221;displaydate.js&#8221; type=&#8221;text/javascript&#8221;</strong>&gt;</span></p>
<p class="MsoNormal" style="background:#efefef;line-height:normal;margin:0;"><span style="font-size:10pt;color:black;font-family:&quot;">&lt;/script&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:black;font-family:&quot;">By including the above reference, your browser will now download the code stored inside displaydate.js, and run it as if the code was physically typed onto the page. The library file does not have to be stored in the same directory as the page using it. In fact, you can even reference a library that&#8217;s on a distant domain!</span></p>
<p class="MsoNormal" style="background:#efefef;line-height:normal;margin:0;"><span style="font-size:10pt;color:black;font-family:&quot;">&lt;script <strong>src=&#8221;http://www.yahoo.com/displaydate.js&#8221;</strong>&gt;</span></p>
<p class="MsoNormal" style="background:#efefef;line-height:normal;margin:0;"><span style="font-size:10pt;color:black;font-family:&quot;">&lt;/script&gt;</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 10pt;"><span style="font-size:10pt;color:black;font-family:&quot;">While the biggest reason for using JavaScript libraries is obvious (allows you to easily distribute one code for use on many pages), a secondary reason is not. A JavaScript library, when used on multiple pages, is actually more efficient than directly embedding the code inside the library on each page. Once the browser encounters the library the first time around, it saves the containing code in cache. Subsequent requests for the library on other pages will result in the library being loaded from cache, or the speed demon!</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=21&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2009/03/16/creating-javascript-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>Resource file in .Net</title>
		<link>http://gazishaheen.wordpress.com/2009/03/16/resource-file-in-net/</link>
		<comments>http://gazishaheen.wordpress.com/2009/03/16/resource-file-in-net/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 11:59:45 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=17</guid>
		<description><![CDATA[How to create a resource. In my case, I want to create an icon. It&#8217;s a similar process, no matter what sort of data you want to add as a resource though. 1. Right click the project you want to add a resource to. Do this in the Solution Explorer. Select the &#8220;Properties&#8221; option from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=17&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to create a resource. In my case, I want to create an icon. It&#8217;s a similar process, no matter what sort of data you want to add as a resource though. 1. Right click the project you want to add a resource to. Do this in the Solution Explorer. Select the &#8220;Properties&#8221; option from the list. 2. Click the &#8220;Resources&#8221; tab. 3. The first button along the top of the bar will let you select the type of resource you want to add. It should start on string. We want to add an icon, so click on it and select &#8220;Icons&#8221; from the list of options. 4. Next, move to the second button, &#8220;Add Resource&#8221;. You can either add a new resource, or if you already have an icon already made, you can add that too. Follow the prompts for whichever option you choose. 5. At this point, you can double click the newly added resource to edit it. Note, resources also show up in the Solution Explorer, and double clicking there is just as effective How to use a resource. Great, so we have our new resource and we&#8217;re itching to have those lovely changing icons&#8230; How do we do that? Well, lucky us, C# makes this exceedingly easy. There is a class called Properties.Resources that gives you access too all your resources, so my code ended up being as simple as: paused = !paused; if (paused) notifyIcon.Icon = Properties.Resources.Red; else notifyIcon.Icon = Properties.Resources.Green; From my experience: Use of Resource file in windows application I have only worked with string resources.  First use some namespaces using System.Resources; using System.Globalization;  Add resource file.  Initialize resource manager in form constructor method. m_ResourceManager = new ResourceManager(&#8220;[namespace].[resourceFilePath]&#8220;, System.Reflection.Assembly.GetExecutingAssembly());  Set Culture value in same method, right after initializing resource manager. Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;  Read the string resource in the following way- m_ResourceManager.GetString(&#8220;[string_key]&#8220;) From my experience: Use of Resource file in web application  Add Asp folder App_GlobalResources then add resource files in this folder.  Read the string resource in the following way- In .aspx page : In (.cs)code behind file: Resources.[ResourceFileName].[key];</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=17&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2009/03/16/resource-file-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>How to configure SQL Server 2005 to allow remote connections</title>
		<link>http://gazishaheen.wordpress.com/2008/06/07/how-to-configure-sql-server-2005-to-allow-remote-connections/</link>
		<comments>http://gazishaheen.wordpress.com/2008/06/07/how-to-configure-sql-server-2005-to-allow-remote-connections/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 06:05:13 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=9</guid>
		<description><![CDATA[How to configure SQL Server 2005 to allow remote connections function loadTOCNode(){} var sectionFilter = &#8220;type != &#8216;notice&#8217; &#38;&#38; type != &#8216;securedata&#8217; &#38;&#38; type != &#8216;querywords&#8217;&#8221;; var tocArrow = &#8220;/library/images/support/kbgraphics/public/en-us/downarrow.gif&#8221;; var depthLimit = 10; var depth3Limit = 10; var depth4Limit = 5; var depth5Limit = 3; var tocEntryMinimum = 1; INTRODUCTION loadTOCNode(1, &#8216;summary&#8217;); When you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=9&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 class="title">How to configure SQL Server 2005 to allow remote  connections</h1>
<p>function loadTOCNode(){}</p>
<div class="articleProperty">
<table border="0">
<tbody>
<tr>
<td></td>
</tr>
<tr></tr>
<tr></tr>
</tbody>
</table>
</div>
<p>      var sectionFilter = &#8220;type != &#8216;notice&#8217; &amp;&amp; type != &#8216;securedata&#8217; &amp;&amp; type != &#8216;querywords&#8217;&#8221;;<br />
      var tocArrow = &#8220;/library/images/support/kbgraphics/public/en-us/downarrow.gif&#8221;;<br />
      var depthLimit = 10;<br />
      var depth3Limit = 10;<br />
      var depth4Limit = 5;<br />
      var depth5Limit = 3;<br />
      var tocEntryMinimum = 1;</p>
<div class="section">
<h2 class="subTitle">INTRODUCTION</h2>
<p>loadTOCNode(1, &#8216;summary&#8217;);</p>
<div class="sbody">When you try to connect to an instance of Microsoft SQL Server  2005 from a remote computer, you may receive an error message. This problem may  occur when you use any program to connect to SQL Server. For example, you  receive the following error message when you use the SQLCMD utility to connect  to SQL Server:</p>
<div class="errormsg">Sqlcmd: Error: Microsoft SQL Native Client: An error has  occurred while establishing a connection to the server. When connecting to SQL  Server 2005, this failure may be caused by the fact that under the default  settings SQL Server does not allow remote connections.</div>
<p>This problem may  occur when SQL Server 2005 is not configured to accept remote connections. By  default, SQL Server 2005 Express Edition and SQL Server 2005 Developer Edition  do not allow remote connections. To configure SQL Server 2005 to allow remote  connections, complete all the following steps:</p>
<table class="list ul" border="0">
<tbody>
<tr>
<td class="bullet">•</td>
<td class="text">Enable remote connections on the instance of SQL Server that you  want to connect to from a remote computer.</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Turn on the SQL Server Browser service.</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Configure the firewall to allow network traffic that is related  to SQL Server and to the SQL Server Browser  service.</td>
</tr>
</tbody>
</table>
<p>This article describes how to complete each of  these steps.</p>
<p class="topOfPage"><a href="#top"><img src="/library/images/support/kbgraphics/public/en-us/uparrow.gif" alt="" /> </a></p>
</div>
<h2 class="subTitle">MORE INFORMATION</h2>
<p>loadTOCNode(1, &#8216;moreinformation&#8217;);</p>
<div class="sbody">To enable remote connections on the instance of SQL Server 2005  and to turn on the SQL Server Browser service, use the SQL Server 2005 Surface  Area Configuration tool. The Surface Area Configuration tool is installed when  you install SQL Server 2005.</p>
<p class="topOfPage"><a href="#top"><img src="/library/images/support/kbgraphics/public/en-us/uparrow.gif" alt="" /> </a></p>
<h3>Enable remote connections for SQL Server 2005 Express or SQL  Server 2005 Developer Edition</h3>
<p>loadTOCNode(2, &#8216;moreinformation&#8217;); You must enable remote connections for each instance of SQL Server 2005 that you  want to connect to from a remote computer. To do this, follow these steps:</p>
<table class="list ol" border="0">
<tbody>
<tr>
<td class="number">1.</td>
<td class="text">Click <strong>Start</strong>, point to <strong>Programs</strong>, point to <strong>Microsoft SQL  Server 2005</strong>, point to <strong>Configuration  Tools</strong>, and then click <strong>SQL Server Surface Area  Configuration</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">On the <strong>SQL Server 2005 Surface Area  Configuration</strong> page, click <strong>Surface Area  Configuration for Services and Connections</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">On the <strong>Surface Area Configuration for  Services and Connections</strong> page, expand <strong>Database  Engine</strong>, click <strong>Remote Connections</strong>, click  <strong>Local and remote connections</strong>, click the  appropriate protocol to enable for your environment, and then click <strong>Apply</strong>.</p>
<p><strong>Note</strong> Click <strong>OK</strong> when you receive the following message:</p>
<div class="message">Changes to Connection Settings will not take effect until you  restart the Database Engine service.</div>
</td>
</tr>
<tr>
<td class="number">4.</td>
<td class="text">On the <strong>Surface Area Configuration for  Services and Connections</strong> page, expand <strong>Database  Engine</strong>, click <strong>Service</strong>, click <strong>Stop</strong>, wait until the MSSQLSERVER service stops, and then  click <strong>Start</strong> to restart the MSSQLSERVER  service.</td>
</tr>
</tbody>
</table>
<p class="topOfPage"><a href="#top"><img src="/library/images/support/kbgraphics/public/en-us/uparrow.gif" alt="" /> </a></p>
<h3>Enable the SQL Server Browser service</h3>
<p>loadTOCNode(2, &#8216;moreinformation&#8217;); If you are running SQL Server 2005 by using an instance name and you are not  using a specific TCP/IP port number in your connection string, you must enable  the SQL Server Browser service to allow for remote connections. For example, SQL  Server 2005 Express is installed with a default instance name of <var>Computer  Name</var>\SQLEXPRESS. You are only required to enable the SQL Server Browser  service one time, regardless of how many instances of SQL Server 2005 you are  running. To enable the SQL Server Browser service, follow these  steps.</p>
<p><strong>Important</strong> These steps may increase your security risk.  These steps may also make your computer or your network more vulnerable to  attack by malicious users or by malicious software such as viruses. We recommend  the process that this article describes to enable programs to operate as they  are designed to, or to implement specific program capabilities. Before you make  these changes, we recommend that you evaluate the risks that are associated with  implementing this process in your particular environment. If you choose to  implement this process, take any appropriate additional steps to help protect  your system. We recommend that you use this process only if you really require  this process.</p>
<table class="list ol" border="0">
<tbody>
<tr>
<td class="number">1.</td>
<td class="text">Click <strong>Start</strong>, point to <strong>Programs</strong>, point to <strong>Microsoft SQL  Server 2005</strong>, point to <strong>Configuration  Tools</strong>, and then click <strong>SQL Server Surface Area  Configuration</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">On the <strong>SQL Server 2005 Surface Area  Configuration</strong> page, click <strong>Surface Area  Configuration for Services and Connections</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">On the <strong>Surface Area Configuration for  Services and Connections</strong> page, click <strong>SQL Server  Browser</strong>, click <strong>Automatic</strong> for <strong>Startup type</strong>, and then click <strong>Apply</strong>.</p>
<p><strong>Note</strong> When you click the <strong>Automatic</strong> option, the SQL Server Browser service starts  automatically every time that you start Microsoft Windows.</td>
</tr>
<tr>
<td class="number">4.</td>
<td class="text">Click <strong>Start</strong>, and then click <strong>OK</strong>.</td>
</tr>
</tbody>
</table>
<p><strong>Note</strong> When you run the  SQL Server Browser service on a computer, the computer displays the instance  names and the connection information for each instance of SQL Server that is  running on the computer. This risk can be reduced by not enabling the SQL Server  Browser service and by connecting to the instance of SQL Server directly through  an assigned TCP port. Connecting directly to an instance of SQL Server through a  TCP port is beyond the scope of this article. For more information about the SQL  Server Browser server and connecting to an instance of SQL Server, see the  following topics in SQL Server Books Online:</p>
<table class="list ul" border="0">
<tbody>
<tr>
<td class="bullet">•</td>
<td class="text">SQL Server Browser Service</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Connecting to the SQL Server Database Engine</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Client Network Configuration</td>
</tr>
</tbody>
</table>
<p class="topOfPage"><a href="#top"><img src="/library/images/support/kbgraphics/public/en-us/uparrow.gif" alt="" /> </a></p>
<h3>Create exceptions in Windows Firewall</h3>
<p>loadTOCNode(2, &#8216;moreinformation&#8217;); These steps apply to the version of Windows Firewall that is included in Windows  XP Service Pack 2 (SP2) and in Windows Server 2003. If you are using a different  firewall system, see your firewall documentation for more information.</p>
<p>If you are running a firewall on the computer that is running SQL Server  2005, external connections to SQL Server 2005 will be blocked unless SQL Server  2005 and the SQL Server Browser service can communicate through the firewall.  You must create an exception for each instance of SQL Server 2005 that you want  to accept remote connections and an exception for the SQL Server Browser  service.</p>
<p>SQL Server 2005 uses an instance ID as part of the path when you  install its program files. To create an exception for each instance of SQL  Server, you must identify the correct instance ID. To obtain an instance ID,  follow these steps:</p>
<table class="list ol" border="0">
<tbody>
<tr>
<td class="number">1.</td>
<td class="text">Click <strong>Start</strong>, point to <strong>Programs</strong>, point to <strong>Microsoft SQL  Server 2005</strong>, point to <strong>Configuration  Tools</strong>, and then click <strong>SQL Server Configuration  Manager</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">In SQL Server Configuration Manager, click the SQL Server Browser  service in the right pane, right-click the instance name in the main window, and  then click <strong>Properties</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">On the <strong>SQL Server Browser  Properties</strong> page, click the <strong>Advanced</strong> tab,  locate the instance ID in the property list, and then click <strong>OK</strong>.</td>
</tr>
</tbody>
</table>
<p>To open Windows Firewall,  click <strong>Start</strong>, click <strong>Run</strong>, type <span class="userInput">firewall.cpl</span>, and  then click <strong>OK</strong>.</p>
<h4>Create an exception for SQL Server 2005 in Windows  Firewall</h4>
<p>loadTOCNode(3, &#8216;moreinformation&#8217;); To create an exception for SQL Server 2005 in Windows Firewall, follow these  steps:</p>
<table class="list ol" border="0">
<tbody>
<tr>
<td class="number">1.</td>
<td class="text">In Windows Firewall, click the <strong>Exceptions</strong> tab, and then click <strong>Add  Program</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">In the Add a Program window, click <strong>Browse</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">Click the C:\Program Files\Microsoft SQL  Server\<var>MSSQL.1</var>\MSSQL\Binn\sqlservr.exe executable program, click  <strong>Open</strong>, and then click <strong>OK</strong>.</p>
<p><strong>Note</strong> The path may be different  depending on where SQL Server 2005 is installed. <var>MSSQL.1</var> is a  placeholder for the instance ID that you obtained in step 3 of the previous  procedure.</td>
</tr>
<tr>
<td class="number">4.</td>
<td class="text">Repeat steps 1 through 3 for each instance of SQL Server 2005  that needs an exception.</td>
</tr>
</tbody>
</table>
<h4>Create an exception for the SQL Server Browser service in  Windows Firewall</h4>
<p>loadTOCNode(3, &#8216;moreinformation&#8217;); To create an exception for the SQL Server Browser service in Windows Firewall,  follow these steps:</p>
<table class="list ol" border="0">
<tbody>
<tr>
<td class="number">1.</td>
<td class="text">In Windows Firewall, click the <strong>Exceptions</strong> tab, and then click <strong>Add  Program</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">In the Add a Program window, click <strong>Browse</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">Click the C:\Program Files\Microsoft SQL  Server\90\Shared\sqlbrowser.exe executable program, click <strong>Open</strong>, and then click <strong>OK</strong>.</p>
<p><strong>Note</strong> The path may be different depending on where SQL Server 2005  is installed.</td>
</tr>
</tbody>
</table>
</div>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=9&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/06/07/how-to-configure-sql-server-2005-to-allow-remote-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>Query on varchar field ignoring case&#8230;</title>
		<link>http://gazishaheen.wordpress.com/2008/05/31/query-on-varchar-field-ignoring-case/</link>
		<comments>http://gazishaheen.wordpress.com/2008/05/31/query-on-varchar-field-ignoring-case/#comments</comments>
		<pubDate>Sat, 31 May 2008 19:22:26 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=7</guid>
		<description><![CDATA[What will I do when I want to search a string in a varchar field, but case have to be ignored? &#8211;&#62;The sample query has given me solution. select * from table1 where IGNORE CASE (field1 != field2); In Case of SQL Server 2005, it compares varchar ignoring case (by default).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=7&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>What will I do when I want to search a string in a varchar field, but case have to be ignored?<br />
&#8211;&gt;The sample query has given me solution.</strong></p>
<p>select *<br />
from table1<br />
where IGNORE CASE (field1 != field2);</p>
<p>In Case of SQL Server 2005, it compares varchar ignoring case (by default).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=7&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/05/31/query-on-varchar-field-ignoring-case/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>sql query(help for pagination)</title>
		<link>http://gazishaheen.wordpress.com/2008/05/05/sql-queryhelp-for-pagination/</link>
		<comments>http://gazishaheen.wordpress.com/2008/05/05/sql-queryhelp-for-pagination/#comments</comments>
		<pubDate>Mon, 05 May 2008 10:00:32 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=5</guid>
		<description><![CDATA[SELECT * FROM `student` LIMIT 20, 10 This will return 10 records from 21st record. That is from 21st record to 30th  record. Here is the output<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=5&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>SELECT * FROM `student` LIMIT 20, 10</p>
<p></strong>This will return 10 records from 21st record. That is from 21st record to 30th  record. Here is the output</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=5&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/05/05/sql-queryhelp-for-pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>XML Document</title>
		<link>http://gazishaheen.wordpress.com/2008/04/07/xml-document/</link>
		<comments>http://gazishaheen.wordpress.com/2008/04/07/xml-document/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 08:06:33 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[C#.Net]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=4</guid>
		<description><![CDATA[You have an XML document that needs to be broken apart into its constituent parts. Each part can then be sent to a different destination (possibly a web service) to be processed individually. This solution is useful when you have a large document, such as a phonebook , an invoice and etc, in XML form. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=4&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You have an XML document that needs to be broken apart into its constituent parts. Each part can then be sent to a different destination (possibly a web service) to be processed individually. This solution is useful when you have a large document, such as a phonebook , an invoice and etc, in XML form.</p>
<p>In order to separate the XML items, we will load an <span style="font-size:x-small;font-family:Courier New;">XmlDocument</span> with the invoice XML from the <em>MyDoc.xml</em> file:</p>
<div id="premain0" class="precollapse" style="width:100%;"><img style="cursor:pointer;" src="http://www.codeproject.com/images/minus.gif" alt="" width="9" height="9" /><span style="margin-bottom:0;cursor:pointer;"> Collapse</span></div>
<div id="pre0" class="no-vmads" style="margin-top:0;">
<pre><span class="code-keyword">&lt;</span>?xml version=<span class="code-string">"</span><span class="code-string">1.0"</span> encoding=<span class="code-string">"</span><span class="code-string">UTF-8"</span> ?<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>MyDoc Date=<span class="code-string">'</span><span class="code-string">2005-10-31'</span> Designer=<span class="code-string">'</span><span class="code-string">Shahab Fatemi'</span><span class="code-keyword">&gt;</span>
<span class="code-keyword">&lt;</span>Test<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>Date<span class="code-keyword">&gt;</span><span class="code-digit">2005</span>-<span class="code-digit">10</span>-<span class="code-digit">31</span><span class="code-keyword">&lt;</span>/Date<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>PersianDate<span class="code-keyword">&gt;</span><span class="code-digit">1384</span>-<span class="code-digit">08</span>-<span class="code-digit">09</span><span class="code-keyword">&lt;</span>/PersianDate<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/Test<span class="code-keyword">&gt;</span>
<span class="code-keyword">&lt;</span>BookList<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>C#.NET<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>Author<span class="code-keyword">&gt;</span>Shahab Fatemi<span class="code-keyword">&lt;</span>/Author<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>Price<span class="code-keyword">&gt;</span><span class="code-digit">49</span>.99$<span class="code-keyword">&lt;</span>/Price<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>Publisher<span class="code-keyword">&gt;</span>Naji<span class="code-keyword">&lt;</span>/Publisher<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/BookList<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>PhoneBook<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">1'</span><span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Shahab<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Fatemi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>
     <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">319</span>-<span class="code-digit">9328</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>shahab_f_m@yahoo.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">2'</span><span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Noosha<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>xx<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-xxx-xxxx<span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>noosha@x.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">3'</span><span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Navid<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Khosravi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">123</span>-<span class="code-digit">4567</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>navid@x.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">4'</span><span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Mehrdad<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Saifi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">123</span>-<span class="code-digit">4567</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>kechele@kachal.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/PhoneBook<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/MyDoc<span class="code-keyword">&gt;</span></pre>
</div>
<p>The code to tear this document apart, and send the various information pieces to their respective departments, is shown here:</p>
<div id="premain1" class="precollapse" style="width:100%;"><img style="cursor:pointer;" src="http://www.codeproject.com/images/minus.gif" alt="" width="9" height="9" /><span style="margin-bottom:0;cursor:pointer;"> Collapse</span></div>
<div id="pre1" class="no-vmads" style="margin-top:0;">
<pre><span class="code-preprocessor">#region</span> XML

XmlDocument xmlDoc = <span class="code-keyword">new</span> XmlDocument( );

<span class="code-comment">//</span><span class="code-comment"> pick up MyDoc from deposited directory
</span>
xmlDoc.Load(<span class="code-string">@"</span><span class="code-string">..\..\MyDoc.xml"</span>);

<span class="code-comment">//</span><span class="code-comment"> get the MyDoc element node
</span>
XmlNode MyDoc = xmlDoc.SelectSingleNode(<span class="code-string">"</span><span class="code-string">/MyDoc"</span>);

<span class="code-comment">//</span><span class="code-comment"> get the MyDoc date attribute
</span>
XmlAttribute invDate = 

(XmlAttribute)MyDoc.Attributes.GetNamedItem(<span class="code-string">"</span><span class="code-string">Date"</span>);

<span class="code-comment">//</span><span class="code-comment"> get the MyDoc number attribute
</span>
XmlAttribute invNum = 

(XmlAttribute)MyDoc.Attributes.GetNamedItem(<span class="code-string">"</span><span class="code-string">Designer"</span>);

<span class="code-preprocessor">#endregion</span>

<span class="code-preprocessor">#region</span> tear apart <span class="code-keyword">&lt;</span>Test<span class="code-keyword">&gt;</span>

<span class="code-comment">//</span><span class="code-comment"> Process the &lt;Test&gt; information to Accounting
</span>
XmlElement Test = xmlDoc.CreateElement(<span class="code-string">"</span><span class="code-string">Test"</span>);

<span class="code-comment">//</span><span class="code-comment"> correlate this information back to the original MyDoc number and date
</span>
Test.Attributes.Append((XmlAttribute)invDate.Clone( ));

Test.Attributes.Append((XmlAttribute)invNum.Clone( ));

XmlNodeList TestList = xmlDoc.SelectNodes(<span class="code-string">"</span><span class="code-string">/MyDoc/Test"</span>);

<span class="code-comment">//</span><span class="code-comment"> add the &lt;Test&gt; information to the document
</span>
foreach(XmlNode TestInfo <span class="code-keyword">in</span> TestList)

{

Test.AppendChild(TestInfo.Clone( ));

}

Console.WriteLine(<span class="code-string">"</span><span class="code-string">Test:\r\n{0}"</span>,Test.OuterXml);

<span class="code-comment">//</span><span class="code-comment"> Save a copy of the document
</span>
FileStream fileStream = File.Create(<span class="code-string">@"</span><span class="code-string">..\..\Test.xml"</span>);

<span class="code-SDKkeyword">byte</span> [] bytes = Encoding.ASCII.GetBytes(Test.OuterXml);

fileStream.Write(bytes,<span class="code-digit">0</span>,bytes.Length);

fileStream.Close( );

<span class="code-preprocessor">#endregion</span>

<span class="code-preprocessor">#region</span> tear apart <span class="code-keyword">&lt;</span>BookList<span class="code-keyword">&gt;</span>

<span class="code-comment">//</span><span class="code-comment"> Process the &lt;BookList&gt; information to Accounting
</span>
XmlElement BookList = xmlDoc.CreateElement(<span class="code-string">"</span><span class="code-string">BookList"</span>);

<span class="code-comment">//</span><span class="code-comment"> correlate this information back to the original MyDoc number and date
</span>
BookList.Attributes.Append((XmlAttribute)invDate.Clone( ));

BookList.Attributes.Append((XmlAttribute)invNum.Clone( ));

XmlNodeList Booklist = xmlDoc.SelectNodes(<span class="code-string">"</span><span class="code-string">/MyDoc/BookList"</span>);

<span class="code-comment">//</span><span class="code-comment"> add the &lt;BookList&gt; information to the document
</span>
foreach(XmlNode BookListInfo <span class="code-keyword">in</span> Booklist)

{

BookList.AppendChild(BookListInfo.Clone( ));

}

Console.WriteLine(<span class="code-string">"</span><span class="code-string">BookList:\r\n{0}"</span>,BookList.OuterXml);

<span class="code-comment">//</span><span class="code-comment"> Save a copy of the document
</span>
fileStream = File.Create(<span class="code-string">@"</span><span class="code-string">..\..\BookList.xml"</span>);

bytes = Encoding.ASCII.GetBytes(BookList.OuterXml);

fileStream.Write(bytes,<span class="code-digit">0</span>,bytes.Length);

fileStream.Close( );

<span class="code-preprocessor">#endregion</span>

<span class="code-preprocessor">#region</span> tear apart <span class="code-keyword">&lt;</span>PhoneBook<span class="code-keyword">&gt;</span>

<span class="code-comment">//</span><span class="code-comment"> Process the item information to &lt;PhoneBook&gt;
</span>
XmlElement PhoneBook = xmlDoc.CreateElement(<span class="code-string">"</span><span class="code-string">PhoneBook"</span>);

<span class="code-comment">//</span><span class="code-comment"> correlate this information back to the original MyDoc number and date
</span>
PhoneBook.Attributes.Append((XmlAttribute)invDate.Clone( ));

PhoneBook.Attributes.Append((XmlAttribute)invNum.Clone( ));

XmlNodeList itemList = xmlDoc.SelectNodes(<span class="code-string">"</span><span class="code-string">/MyDoc/PhoneBook/No"</span>);

<span class="code-comment">//</span><span class="code-comment"> add the item information to the document
</span>
foreach(XmlNode item <span class="code-keyword">in</span> itemList)

{

PhoneBook.AppendChild(item.Clone( ));

}

Console.WriteLine(<span class="code-string">"</span><span class="code-string">PhoneBook:\r\n{0}"</span>,PhoneBook.OuterXml);

<span class="code-comment">//</span><span class="code-comment"> Save a copy of the document
</span>
fileStream = File.Create(<span class="code-string">@"</span><span class="code-string">..\..\PhoneBook.xml"</span>);

bytes = Encoding.ASCII.GetBytes(PhoneBook.OuterXml);

fileStream.Write(bytes,<span class="code-digit">0</span>,bytes.Length);

fileStream.Close( );

<span class="code-preprocessor">#endregion</span></pre>
</div>
<p>The &#8220;MyDoc&#8221; containing the various pieces of XML data for the web services are listed in the following sections:</p>
<h2><em>Result</em></h2>
<h4>Test.XML</h4>
<div class="no-vmads">
<pre><span class="code-keyword">&lt;</span>Test Date=<span class="code-string">"</span><span class="code-string">2005-10-31"</span> Designer=<span class="code-string">"</span><span class="code-string">Shahab Fatemi"</span><span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>Test<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Date<span class="code-keyword">&gt;</span><span class="code-digit">2005</span>-<span class="code-digit">10</span>-<span class="code-digit">31</span><span class="code-keyword">&lt;</span>/Date<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>PersianDate<span class="code-keyword">&gt;</span><span class="code-digit">1384</span>-<span class="code-digit">08</span>-<span class="code-digit">09</span><span class="code-keyword">&lt;</span>/PersianDate<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/Test<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/Test<span class="code-keyword">&gt;</span></pre>
</div>
<h4>BookList.XML</h4>
<div class="no-vmads">
<pre><span class="code-keyword">&lt;</span>BookList Date=<span class="code-string">"</span><span class="code-string">2005-10-31"</span> Designer=<span class="code-string">"</span><span class="code-string">Shahab Fatemi"</span><span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>BookList<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>C#.NET<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Author<span class="code-keyword">&gt;</span>Shahab Fatemi<span class="code-keyword">&lt;</span>/Author<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Price<span class="code-keyword">&gt;</span><span class="code-digit">49</span>.99$<span class="code-keyword">&lt;</span>/Price<span class="code-keyword">&gt;</span>
     <span class="code-keyword">&lt;</span>Publisher<span class="code-keyword">&gt;</span>Naji<span class="code-keyword">&lt;</span>/Publisher<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/BookList<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/BookList<span class="code-keyword">&gt;</span></pre>
</div>
<h4>PhoneBook.XML</h4>
<div id="premain4" class="precollapse" style="width:100%;"><img style="cursor:pointer;" src="http://www.codeproject.com/images/minus.gif" alt="" width="9" height="9" /><span style="margin-bottom:0;cursor:pointer;"> Collapse</span></div>
<div id="pre4" class="no-vmads" style="margin-top:0;">
<pre><span class="code-keyword">&lt;</span>PhoneBook<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">1'</span><span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Shahab<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Fatemi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>
     <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">319</span>-<span class="code-digit">9328</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>shahab_f_m@yahoo.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">2'</span><span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Noosha<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>xx<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-xxx-xxxx<span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>noosha@x.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">3'</span><span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Navid<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Khosravi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">123</span>-<span class="code-digit">4567</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>navid@x.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>
   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>No number=<span class="code-string">'</span><span class="code-string">4'</span><span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Name<span class="code-keyword">&gt;</span>Mehrdad<span class="code-keyword">&lt;</span>/Name<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>Family<span class="code-keyword">&gt;</span>Saifi<span class="code-keyword">&lt;</span>/Family<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>Country<span class="code-keyword">&gt;</span>IRAN<span class="code-keyword">&lt;</span>/Country<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>City<span class="code-keyword">&gt;</span>Esfahan<span class="code-keyword">&lt;</span>/City<span class="code-keyword">&gt;</span>

    <span class="code-keyword">&lt;</span>MobileNumber<span class="code-keyword">&gt;</span><span class="code-digit">0913</span>-<span class="code-digit">123</span>-<span class="code-digit">4567</span><span class="code-keyword">&lt;</span>/MobileNumber<span class="code-keyword">&gt;</span>
    <span class="code-keyword">&lt;</span>E-Mail<span class="code-keyword">&gt;</span>kechele@kachal.com<span class="code-keyword">&lt;</span>/E-Mail<span class="code-keyword">&gt;</span>

   <span class="code-keyword">&lt;</span>/No<span class="code-keyword">&gt;</span>

<span class="code-keyword">&lt;</span>/PhoneBook<span class="code-keyword">&gt;</span>

<span class="code-keyword">How to get </span>
<span class="code-keyword"><span style="font-size:x-small;color:#0000ff;"><font size="2" color="#0000ff">protected

</font></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">object</span><span style="font-size:x-small;"> GetNodeValue(</span><span style="font-size:x-small;color:#2b91af;">XmlDocument</span><span style="font-size:x-small;"> xmlDocumentIn, </span><span style="font-size:x-small;color:#0000ff;">string</span><span style="font-size:x-small;"> sNodeName){

<font size="2"> 

</font></span>

<span style="font-size:x-small;color:#0000ff;">object</span><span style="font-size:x-small;"> oRetVal = </span><span style="font-size:x-small;color:#0000ff;">null</span><span style="font-size:x-small;">;<font size="2"> 

</font></span>

<span style="font-size:x-small;color:#008000;">/* Returns the list of nodes whose name is 'sNodeName' */</span>

<span style="font-size:x-small;"><font size="2"> 

</font></span><span style="font-size:x-small;color:#2b91af;">XmlNodeList</span><span style="font-size:x-small;"> oxmlNodeList = xmlDocumentIn.GetElementsByTagName(sNodeName);<font size="2"> 

</font></span>

<span style="font-size:x-small;color:#008000;">/*Looping through the xml nodes to get the first one */</span>

<span style="font-size:x-small;"><font size="2"> 

</font></span><span style="font-size:x-small;color:#0000ff;">foreach</span><span style="font-size:x-small;"> (</span><span style="font-size:x-small;color:#2b91af;">XmlNode</span><span style="font-size:x-small;"> oxmlNode </span><span style="font-size:x-small;color:#0000ff;">in</span><span style="font-size:x-small;"> oxmlNodeList){

oRetVal = oxmlNode.InnerXml;

<font size="2"> 

</font></span>

<span style="font-size:x-small;color:#0000ff;">break</span><span style="font-size:x-small;">;}

<font size="2"> 

</font></span>

<span style="font-size:x-small;color:#0000ff;">return</span><span style="font-size:x-small;"> oRetVal;}

</span>

</span></pre>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=4&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/04/07/xml-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>

		<media:content url="http://www.codeproject.com/images/minus.gif" medium="image" />

		<media:content url="http://www.codeproject.com/images/minus.gif" medium="image" />

		<media:content url="http://www.codeproject.com/images/minus.gif" medium="image" />
	</item>
		<item>
		<title>Out parameter</title>
		<link>http://gazishaheen.wordpress.com/2008/04/06/out-parameter/</link>
		<comments>http://gazishaheen.wordpress.com/2008/04/06/out-parameter/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 05:39:05 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[C#.Net]]></category>

		<guid isPermaLink="false">http://gazishaheen.wordpress.com/?p=3</guid>
		<description><![CDATA[The out and the ref parameters are used to return values in the same variables, that you pass an an argument of a method. These both parameters are very useful when your method needs to return more than one values. In this article, I will explain how do you use these parameters in your C# [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=3&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;">The <strong>out</strong> and the <strong>ref</strong> parameters are used to return values in the same variables, that you pass an an argument of a method. These both parameters are very useful when your method needs to return more than one values.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;">In this article, I will explain how do you use these parameters in your C# applications.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><strong>The out Parameter</strong></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;">The <strong>out</strong> parameter can be used to return the values in the same variable passed as a parameter of the method. Any changes made to the parameter will be reflected in the variable. </span></p>
<div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;"></p>
<div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;">public</span></span></div>
<p></span></span></div>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">class</span><span style="font-size:x-small;"> mathClass<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> TestOut(</span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> iVal1, </span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> iVal2)<br />
{<br />
iVal1 = 10;<br />
iVal2 = 20;<br />
</span><span style="font-size:x-small;color:#0000ff;">return</span><span style="font-size:x-small;"> 0;<br />
}<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">void</span><span style="font-size:x-small;"> Main()<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> i, j; </span><span style="font-size:x-small;color:#008000;">// variable need not be initialized<br />
</span><span style="font-size:x-small;">Console.WriteLine(TestOut(</span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> i, </span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> j));<br />
Console.WriteLine(i);<br />
Console.WriteLine(j);<br />
}<br />
}<br />
</span></p>
<div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;">class</span><span style="font-size:x-small;"> mathClass<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> TestOut(</span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> iVal1, </span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> iVal2)<br />
{<br />
iVal1 = 10;<br />
iVal2 = 20;<br />
</span><span style="font-size:x-small;color:#0000ff;">return</span><span style="font-size:x-small;"> 0;<br />
}<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">void</span><span style="font-size:x-small;"> Main()<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> i, j; </span><span style="font-size:x-small;color:#008000;">// variable need not be initialized<br />
</span><span style="font-size:x-small;">Console.WriteLine(TestOut(</span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> i, </span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> j));<br />
Console.WriteLine(i);<br />
Console.WriteLine(j);<br />
}<br />
}<br />
</span></span></div>
<p></span></span></span><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"> </p>
<p></span></span></p>
<p> </p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><strong>The ref parameter</strong></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;">The <strong>ref</strong> keyword on a method parameter causes a method to refer to the same variable that was passed as an input parameter for the same method. If you do any changes to the variable, they will be reflected in the variable.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;">You can even use ref for more than one method parameters. </span></p>
<div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;"></p>
<div><span style="font-size:x-small;color:#0000ff;">namespace</span></div>
<p></span></span></span></div>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;">TestRefP<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">using</span><span style="font-size:x-small;"> System;<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">class</span><span style="font-size:x-small;"> myClass<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">void</span><span style="font-size:x-small;"> RefTest(</span><span style="font-size:x-small;color:#0000ff;">ref</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> iVal1 )<br />
{<br />
iVal1 += 2;<br />
}<br />
</span><span style="font-size:x-small;color:#0000ff;">public</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">static</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#0000ff;">void</span><span style="font-size:x-small;"> Main()<br />
{<br />
</span><span style="font-size:x-small;color:#0000ff;">int</span><span style="font-size:x-small;"> i; </span><span style="font-size:x-small;color:#008000;">// variable need to be initialized<br />
</span><span style="font-size:x-small;">i = 3;<br />
RefTest(</span><span style="font-size:x-small;color:#0000ff;">ref</span><span style="font-size:x-small;"> i );<br />
Console.WriteLine(i);<br />
}<br />
}<br />
} </span></p>
<p></span></span> </p>
<p></span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=3&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/04/06/out-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
		<item>
		<title>Screen Shot on MAC OS</title>
		<link>http://gazishaheen.wordpress.com/2008/03/09/hello-world/</link>
		<comments>http://gazishaheen.wordpress.com/2008/03/09/hello-world/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 12:49:28 +0000</pubDate>
		<dc:creator>gazishaheen</dc:creator>
				<category><![CDATA[MAC OS]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[March 9, 2008 Print Screen on Mac OS: Who Needs A Print Screen Key? One would assume that there is no print screen function in OS X. Well, I got some news and it might be a shocker. OS X has more robust print screen functionality than Windows XP. Just use any of the following commands [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=1&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b><span><font face="Times New Roman">March 9, 2008</font></span></b><b><span><font face="Times New Roman"> </font></span></b><b><span style="font-size:13.5pt;color:black;font-family:'Lucida Grande';"><font face="Times New Roman">Print Screen on Mac OS: </font><a href="http://www.lockergnome.com/osx/2005/02/04/who-needs-a-print-screen-key/" title=" Who Needs A Print Screen Key?"><span style="color:black;text-decoration:none;"><font face="Times New Roman">Who Needs A Print Screen Key?</font></span></a></span></b></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">One would assume that there is no print screen function in OS X. Well, I got some news and it might be a shocker. OS X has more robust print screen functionality than </font><a target="_top" href="http://www.lockergnome.com/osx/2005/02/04/who-needs-a-print-screen-key/"><span class="klink"><font face="Times New Roman">Windows XP</font></span></a><font face="Times New Roman">.</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">Just use any of the following commands to place a shiny new PDF on your desktop. </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><strong>CMD + Shift + 3</strong><br />
This will take a screenshot of your entire screen. </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><strong>CMD + Shift + 4</strong><br />
This will bring up a selection tool so you can make a rectangular screenshot of a certain area. </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><strong>CMD + Shift + 4 + Space Bar</strong><br />
This will turn your </font><a target="_top" href="http://www.lockergnome.com/osx/2005/02/04/who-needs-a-print-screen-key/"><span class="klink"><font face="Times New Roman">cursor</font></span></a><font face="Times New Roman"> into a tiny camera. Use this camera to take a picture of the Dock, a menu, or a window and it will crop the background automatically for the resulting image. </font></p>
<p><span style="font-size:12pt;font-family:'Times New Roman';">Note: If you hold down the Control key during and of the above commands the image gets copied to your clipboard, ready to paste, rather than creating a PDF on your desktop</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gazishaheen.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gazishaheen.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gazishaheen.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gazishaheen.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gazishaheen.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gazishaheen.wordpress.com&amp;blog=3105865&amp;post=1&amp;subd=gazishaheen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gazishaheen.wordpress.com/2008/03/09/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d4b26ad22670e1975479f29d186e748c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gazishaheen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
