<?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>Ocpmunir&#039;s Blog</title>
	<atom:link href="http://ocpmunir.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ocpmunir.wordpress.com</link>
	<description>A Personal Blog to help  Other IT personnel</description>
	<lastBuildDate>Fri, 19 Aug 2011 17:10:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ocpmunir.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/08270df86827692c80f1bf5282a682a4?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Ocpmunir&#039;s Blog</title>
		<link>http://ocpmunir.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ocpmunir.wordpress.com/osd.xml" title="Ocpmunir&#039;s Blog" />
	<atom:link rel='hub' href='http://ocpmunir.wordpress.com/?pushpress=hub'/>
		<item>
		<title>AutoNumber And Identity Functionality</title>
		<link>http://ocpmunir.wordpress.com/2011/04/13/autonumber-and-identity-functionality/</link>
		<comments>http://ocpmunir.wordpress.com/2011/04/13/autonumber-and-identity-functionality/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 07:29:29 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=99</guid>
		<description><![CDATA[Developers who are used to AutoNumber columns in MS Access or Identity columns in SQL Server often complain when they have to manually populate primary key columns using sequences. This type of functionality is easily implemented in Oracle using triggers. First we create a table with a suitable primary key column and a sequence to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=99&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1></h1>
<p>Developers who are used to <code>AutoNumber</code> columns in MS Access or <code>Identity</code> columns in SQL Server  often complain when they have to manually populate primary key columns using sequences. This type of functionality is easily implemented in Oracle using triggers.</p>
<p>First we create a table with a suitable primary key column and a sequence to support it:</p>
<blockquote>
<pre>CREATE TABLE departments (
  ID           NUMBER(10)    NOT NULL,
  DESCRIPTION  VARCHAR2(50)  NOT NULL);

ALTER TABLE departments ADD (
  CONSTRAINT dept_pk PRIMARY KEY (ID));

CREATE SEQUENCE dept_seq;</pre>
</blockquote>
<p>Next we create a trigger to populate the <code>ID</code> column if it&#8217;s not specified in the insert:</p>
<blockquote>
<pre>CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
FOR EACH ROW
WHEN (new.id IS NULL)
BEGIN
  SELECT dept_seq.NEXTVAL
  INTO   :new.id
  FROM   dual;
END;
/</pre>
</blockquote>
<p>Finally we can test it using the automatic and manual population methods:</p>
<blockquote>
<pre>SQL&gt; INSERT INTO departments (description)
  2  VALUES ('Development');

1 row created.

SQL&gt; SELECT * FROM departments;

        ID DESCRIPTION
---------- --------------------------------------------------
         1 Development

1 row selected.

SQL&gt; INSERT INTO departments (id, description)
  2  VALUES (dept_seq.NEXTVAL, 'Accounting');

1 row created.

SQL&gt; SELECT * FROM departments;

        ID DESCRIPTION
---------- --------------------------------------------------
         1 Development
         2 Accounting

2 rows selected.

SQL&gt;</pre>
</blockquote>
<p>The trigger can be modified to give slightly different results. If the  insert trigger needs to perform more functionality than this one task  you may wish to do something like:</p>
<blockquote>
<pre>CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
FOR EACH ROW
BEGIN
  SELECT NVL(:new.id, dept_seq.NEXTVAL)
  INTO   :new.id
  FROM   dual;

  -- Do more processing here.
END;
/</pre>
</blockquote>
<p>To overwrite any values passed in you should do the following:</p>
<blockquote>
<pre>CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
FOR EACH ROW
BEGIN
  SELECT dept_seq.NEXTVAL
  INTO   :new.id
  FROM   dual;
END;
/</pre>
</blockquote>
<p>To error if a value is passed in you should do the following:</p>
<blockquote>
<pre>CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
FOR EACH ROW
BEGIN
  IF :new.id IS NOT NULL THEN
    RAISE_APPLICATION_ERROR(-20000, 'ID cannot be specified');
  ELSE
    SELECT dept_seq.NEXTVAL
    INTO   :new.id
    FROM   dual;
  END IF;
END;
/</pre>
</blockquote>
<p>Hope this helps.</p>
<p><a href="http://www.oracle-base.com/articles/misc/AutoNumber.php#Top">Back to the Top.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=99&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2011/04/13/autonumber-and-identity-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Auto Complete in windows application</title>
		<link>http://ocpmunir.wordpress.com/2011/03/09/auto-complete-in-windows-application/</link>
		<comments>http://ocpmunir.wordpress.com/2011/03/09/auto-complete-in-windows-application/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 11:15:00 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=96</guid>
		<description><![CDATA[There are two ways we can use Autocomplete feature 1. Auto complete textBox with previously entered text in textbox. 2. AutoComplete textBox by fetching the data from database. 1. Auto complete textBox with previously entered text in textbox. For filling textbox with previously entered data/text in textbox using Autocomplete feature we can implement by setting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=96&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are two ways we can use Autocomplete feature</p>
<p>1. Auto complete textBox with previously entered text in textbox.</p>
<p>2. AutoComplete textBox by fetching the data from database.</p>
<p>1. Auto complete textBox with previously entered text in textbox.</p>
<p>For filling textbox with previously entered data/text in textbox using Autocomplete feature we can implement by setting autocomplete mode proeprty of textbox to suggest, append or sugestappend and setting autocomplete source to custom source progrmetically</p>
<p>First of all create a global AutoCompleteStringCollection and write code like this<br />
namespace WindowsApplication1<br />
{<br />
public partial class Form1 : Form<br />
{<br />
AutoCompleteStringCollection autoComplete = new AutoCompleteStringCollection();<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}</p>
<p>private void button1_Click(object sender, EventArgs e)<br />
{<br />
autoComplete.Add(textBox1.Text);<br />
MessageBox.Show(&#8220;hello&#8221;);<br />
}</p>
<p>private void Form1_Load(object sender, EventArgs e)<br />
{<br />
textBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;<br />
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;<br />
//auto.Add(textBox1.Text);<br />
textBox1.AutoCompleteCustomSource = autoComplete;<br />
}<br />
}<br />
}</p>
<p>2. AutoComplete textBox by fetching the data from database.</p>
<p>For this i&#8217;ve created a database with a table containing names which will be shown in textbox as suggestions, for this we need to create a AutoCompleteStringCollection and then add the records in this collection using datareader to fetch records from database</p>
<p>For autocomplete functionalty to work we need to define these 3 properties of textbox</p>
<p>1. AutoCompleteMode &#8211; we can choose either suggest or appned or suggestappend as names are self explanatory</p>
<p>2. AutoCompleteSource &#8211; this needs to be set as Custom Source</p>
<p>3. AutoCompleteCustomSource &#8211; this is the collection we created earlier</p>
<p>The complete C# code will look like this</p>
<p>namespace AutoCompleteTextBox<br />
{</p>
<p>public partial class frmAuto : Form<br />
{<br />
public string strConnection =<br />
ConfigurationManager.AppSettings["ConnString"];<br />
AutoCompleteStringCollection namesCollection =<br />
new AutoCompleteStringCollection();<br />
public frmAuto()<br />
{<br />
InitializeComponent();<br />
}</p>
<p>private void frmAuto_Load(object sender, EventArgs e)<br />
{<br />
SqlDataReader dReader;<br />
SqlConnection conn = new SqlConnection();<br />
conn.ConnectionString = strConnection;<br />
SqlCommand cmd = new SqlCommand();<br />
cmd.Connection = conn;<br />
cmd.CommandType = CommandType.Text;<br />
cmd.CommandText =<br />
&#8220;Select distinct [Name] from [Names]&#8221; +<br />
&#8221; order by [Name] asc&#8221;;<br />
conn.Open();<br />
dReader = cmd.ExecuteReader();<br />
if (dReader.HasRows == true)<br />
{<br />
   while (dReader.Read())<br />
   namesCollection.Add(dReader["Name"].ToString());</p>
<p>}<br />
else<br />
{<br />
   MessageBox.Show(&#8220;Data not found&#8221;);<br />
}<br />
dReader.Close();</p>
<p>txtName.AutoCompleteMode = AutoCompleteMode.Suggest;<br />
txtName.AutoCompleteSource = AutoCompleteSource.CustomSource;<br />
txtName.AutoCompleteCustomSource = namesCollection;</p>
<p>}<br />
private void btnCancel_Click(object sender, EventArgs e)<br />
{<br />
Application.Exit();<br />
}<br />
private void btnOk_Click(object sender, EventArgs e)<br />
{<br />
MessageBox.Show(&#8220;Hope you like this example&#8221;);<br />
}</p>
<p>}<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=96&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2011/03/09/auto-complete-in-windows-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Add HTML while using window.open function in javascript</title>
		<link>http://ocpmunir.wordpress.com/2011/02/19/add-html-while-using-window-open-function-in-javascript/</link>
		<comments>http://ocpmunir.wordpress.com/2011/02/19/add-html-while-using-window-open-function-in-javascript/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 11:57:49 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=92</guid>
		<description><![CDATA[&#60;SCRIPT LANGUAGE="JavaScript"&#62; &#60;!-- hide this script from old browsers // This script opens a new browser window and writes // HTML to display an image with a title and caption function show_photo( pFileName, pTitle, pCaption) { // specify window parameters photoWin = window.open( "", "photo", "width=600,height=450,status,scrollbars,resizable, screenX=20,screenY=40,left=20,top=40"); // wrote content to window photoWin.document.write('&#60;html&#62;&#60;head&#62;&#60;title&#62;' + pTitle [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=92&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre><span style="color:#000066;">&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- hide this script from old browsers

// This script opens a new browser window and writes
// HTML to display an image with a title and caption

function show_photo( pFileName, pTitle, pCaption) {

// specify window parameters
  photoWin = window.open( "", "photo",
     "width=600,height=450,status,scrollbars,resizable,
     screenX=20,screenY=40,left=20,top=40");

// wrote content to window
  photoWin.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;' +
    pTitle + '&lt;/title&gt;&lt;/head&gt;');
  photoWin.document.write('&lt;BODY BGCOLOR=#000000 TEXT=#FFFFCC
    LINK=#33CCFF VLINK=#FF6666&gt;');
  photoWin.document.write('&lt;center&gt;');
  photoWin.document.write('&lt;font size=+3
    face="arial,helvetica"&gt;&lt;b&gt;' +
    pCaption + '&lt;/b&gt;&lt;/font&gt;&lt;br&gt;');
  photoWin.document.write('&lt;img src="' +
    pFileName + '"&gt;&lt;p&gt;');
  photoWin.document.write('&lt;font face=
    "arial,helvetica"&gt;');
  photoWin.document.write( '"' + pTitle +
    '" photo &amp;copy; Lorrie Lava&lt;br&gt;');
  photoWin.document.write('&lt;a href="mailto:
    lava@pele.bigu.edu"&gt;
    lava@pele.bigu.edu&lt;/a&gt;&lt;br&gt;');
  photoWin.document.write('Volcanic Studies,
    &lt;a href="http://www.bigu.edu/"&gt;
    Big University&lt;/a&gt;');
  photoWin.document.write('&lt;p&gt;&lt;/font&gt;
    &lt;/body&gt;&lt;/html&gt;');
  photoWin.document.close();	

// If we are on NetScape, we can bring the window to the front
	if (navigator.appName.substring(0,8) ==
	   "Netscape") photoWin.focus();
}
// done hiding from old browsers --&gt;
&lt;/SCRIPT&gt;
</span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=92&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2011/02/19/add-html-while-using-window-open-function-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Run 32 bit .NET applications on 64 bit machines</title>
		<link>http://ocpmunir.wordpress.com/2011/01/04/run-32-bit-net-applications-on-64-bit-machines/</link>
		<comments>http://ocpmunir.wordpress.com/2011/01/04/run-32-bit-net-applications-on-64-bit-machines/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 12:09:51 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=93</guid>
		<description><![CDATA[If you have a 64 bit machine and want to run a .NET application that only works with the 32 bit CLR you would have to make changes to the .NET framework on your machine Set the .NET framework to load the CLR in WOW mode through this command Open up command prompt and type [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=93&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><a title="Permanent Link: Run 32 bit .NET applications on 64 bit machines" rel="bookmark" href="http://techdhaan.wordpress.com/2010/03/15/run-32-bit-net-applications-on-64-bit-machines/"><br />
</a></h2>
<p>If  you have a 64 bit machine and want to run a .NET application that only  works with the 32 bit CLR you would have to make changes to the .NET  framework on your machine</p>
<p>Set the .NET framework to load the CLR in WOW mode through this command</p>
<p>Open up command prompt and type this command</p>
<p>C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe SetWow</p>
<p>Now you should be able to run apps that use only the .NET 32 bit CLR.</p>
<p>To revert back to the default 64 bit framework run</p>
<p>C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=93&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2011/01/04/run-32-bit-net-applications-on-64-bit-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Unable to Connect web dev server</title>
		<link>http://ocpmunir.wordpress.com/2010/11/04/unable-to-connect-web-dev-server/</link>
		<comments>http://ocpmunir.wordpress.com/2010/11/04/unable-to-connect-web-dev-server/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 07:00:35 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[Installation]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=90</guid>
		<description><![CDATA[this problem arise when  WebDev.WebServer.EXE file is corrupted. i soled this problem by replacing this file with new one. this file is located  C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0 Replace this file with new one. hope your problem will be solved&#8230; &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=90&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>this problem arise when  WebDev.WebServer.EXE file is corrupted. i soled this problem by replacing this file with new one. this file is located  C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0</p>
<p>Replace this file with new one. hope your problem will be solved&#8230;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=90&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/11/04/unable-to-connect-web-dev-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>google map help</title>
		<link>http://ocpmunir.wordpress.com/2010/10/18/google-map-help/</link>
		<comments>http://ocpmunir.wordpress.com/2010/10/18/google-map-help/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 11:47:47 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=88</guid>
		<description><![CDATA[visit the link for google map http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx#ga<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=88&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>visit the link for google map</p>
<p><a href="http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx#ga">http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx#ga</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=88&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/10/18/google-map-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Refresh Parent Page from Popup window close button</title>
		<link>http://ocpmunir.wordpress.com/2010/07/27/refresh-parent-page-from-popup-window-close-button/</link>
		<comments>http://ocpmunir.wordpress.com/2010/07/27/refresh-parent-page-from-popup-window-close-button/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 07:38:18 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=81</guid>
		<description><![CDATA[&#60;script language=&#8221;JavaScript&#8221;&#62; &#60;!&#8211; function refreshParent() { window.opener.location.href = window.opener.location.href; if (window.opener.progressWindow) { window.opener.progressWindow.close() } window.close(); } //&#8211;&#62; &#60;/script&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=81&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&lt;script language=&#8221;JavaScript&#8221;&gt;<br />
&lt;!&#8211;<br />
function refreshParent() {<br />
window.opener.location.href = window.opener.location.href;</p>
<p>if (window.opener.progressWindow)<br />
{<br />
window.opener.progressWindow.close()<br />
}<br />
window.close();<br />
}<br />
//&#8211;&gt;<br />
&lt;/script&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=81&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/07/27/refresh-parent-page-from-popup-window-close-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Add Radion Button in a GridView Control</title>
		<link>http://ocpmunir.wordpress.com/2010/07/19/add-radion-button-in-a-gridview-control/</link>
		<comments>http://ocpmunir.wordpress.com/2010/07/19/add-radion-button-in-a-gridview-control/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 04:03:17 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=78</guid>
		<description><![CDATA[GridView Code for aspx page &#60;asp:GridView ID=&#8221;gvAvailableDuration&#8221; runat=&#8221;server&#8221; AutoGenerateColumns=&#8221;False&#8221;  SkinID=&#8221;CJGrid&#8221; onrowcommand=&#8221;gvAvailableDuration_RowCommand&#8221; onrowcreated=&#8221;gvAvailableDuration_RowCreated&#8221;&#62; &#60;Columns&#62; &#60;asp:BoundField DataField=&#8221;AdId&#8221; HeaderText=&#8221;AdId&#8221; Visible=&#8221;false&#8221; /&#62; &#60;asp:TemplateField HeaderText=&#8221;Select&#8221;&#62; &#60;ItemTemplate&#62; &#60;asp:Literal ID=&#8221;rdoRowSelector&#8221; runat=&#8221;server&#8221;&#62;&#60;/asp:Literal&#62; &#60;/ItemTemplate&#62; &#60;/asp:TemplateField&#62; &#60;asp:BoundField DataField=&#8221;startDate&#8221; HeaderText=&#8221;Start Date&#8221;  /&#62; &#60;asp:BoundField DataField=&#8221;EndDate&#8221; HeaderText=&#8221;End Date&#8221;  /&#62; &#60;/Columns&#62; &#60;/asp:GridView&#62; Add  This Code into your CS page protected void gvAvailableDuration_RowCreated(object sender, GridViewRowEventArgs e) { string sStartDate = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=78&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>GridView Code for aspx page</strong></p>
<p>&lt;asp:GridView ID=&#8221;gvAvailableDuration&#8221; runat=&#8221;server&#8221;<br />
AutoGenerateColumns=&#8221;False&#8221;  SkinID=&#8221;CJGrid&#8221;<br />
onrowcommand=&#8221;gvAvailableDuration_RowCommand&#8221;<br />
onrowcreated=&#8221;gvAvailableDuration_RowCreated&#8221;&gt;<br />
&lt;Columns&gt;<br />
&lt;asp:BoundField DataField=&#8221;AdId&#8221; HeaderText=&#8221;AdId&#8221; Visible=&#8221;false&#8221; /&gt;<br />
&lt;asp:TemplateField HeaderText=&#8221;Select&#8221;&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;asp:Literal ID=&#8221;rdoRowSelector&#8221; runat=&#8221;server&#8221;&gt;&lt;/asp:Literal&gt;</p>
<p>&lt;/ItemTemplate&gt;<br />
&lt;/asp:TemplateField&gt;</p>
<p>&lt;asp:BoundField DataField=&#8221;startDate&#8221; HeaderText=&#8221;Start Date&#8221;  /&gt;<br />
&lt;asp:BoundField DataField=&#8221;EndDate&#8221; HeaderText=&#8221;End Date&#8221;  /&gt;</p>
<p>&lt;/Columns&gt;<br />
&lt;/asp:GridView&gt;</p>
<p><strong>Add  This Code into your CS page</strong></p>
<p>protected void gvAvailableDuration_RowCreated(object sender, GridViewRowEventArgs e)<br />
{</p>
<p>string sStartDate = &#8220;&#8221;;<br />
string sEndDate = &#8220;&#8221;;<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
Literal output = (Literal)e.Row.FindControl(&#8220;rdoRowSelector&#8221;);<br />
DataRowView rowV = (DataRowView)e.Row.DataItem;<br />
if (rowV != null)<br />
{<br />
sStartDate = rowV.Row.ItemArray[1].ToString();<br />
sEndDate = rowV.Row.ItemArray[2].ToString();<br />
output.Text = string.Format(&#8220;&lt;input type=&#8217;radio&#8217; name=&#8217;DateGroup&#8217; id=&#8217;&#8221; + e.Row.RowIndex + &#8220;&#8216; value=&#8217;&#8221; + sStartDate + &#8220;$&#8221; + sEndDate + &#8220;&#8216; onclick=&#8217;SetDate(&#8221; + e.Row.RowIndex + &#8220;)&#8217; /&gt;&#8221;, e.Row.RowIndex);<br />
}<br />
}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=78&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/07/19/add-radion-button-in-a-gridview-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>Save and retrieve values in Cookie (C#)</title>
		<link>http://ocpmunir.wordpress.com/2010/07/13/save-and-retrieve-values-in-cookie-c/</link>
		<comments>http://ocpmunir.wordpress.com/2010/07/13/save-and-retrieve-values-in-cookie-c/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 10:16:06 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Cookies]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=75</guid>
		<description><![CDATA[&#60;%@ Page Language="c#" %&#62; &#60;script Language="c#" runat="server"&#62; void Page_Load(object source, EventArgs e) { if (!(IsPostBack)) { MyButton.Text = "Save Cookie"; MyDropDownList.Items.Add("Blue"); MyDropDownList.Items.Add("Red"); MyDropDownList.Items.Add("Gray"); } } public void Click(object sender, EventArgs e) { HttpCookie MyCookie = new HttpCookie("Background"); MyCookie.Value = MyDropDownList.SelectedItem.Text; Response.Cookies.Add(MyCookie); } &#60;/script&#62; &#60;html&#62; &#60;body&#62; &#60;form id=&#8220;CookieForm&#8221; method=&#8220;post&#8221; runat=&#8220;server&#8221;&#62; &#60;asp:DropDownList id=MyDropDownList runat=&#8220;server&#8221;/&#62; &#60;asp:button id=MyButton runat=&#8220;server&#8221; OnClick=&#8220;Click&#8221;/&#62; &#60;/form&#62; &#60;/body&#62; &#60;/html&#62; /////////////////////////////////////////////////// &#60;%@ Page Language=&#8220;c#&#8221; %&#62; &#60;script Language=&#8220;c#&#8221; runat=&#8220;server&#8221;&#62; void Page_Load(object source, EventArgs e) { Response.Cache.SetExpires(DateTime.Now); } string GetBackground() { return Request.Cookies["Background"].Value; } [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=75&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<table border="0" width="800">
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td>
<table border="0">
<tbody>
<tr>
<td height="20"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="3" bgcolor="#ffffff">
<tbody>
<tr><!-- start source code --></p>
<td align="left" valign="top">
<div><code><br />
<span style="color:#000000;">&lt;%@ Page Language=</span><span style="color:#2a00ff;">"c#" </span><span style="color:#000000;">%&gt;</span><br />
<span style="color:#000000;">&lt;script Language=</span><span style="color:#2a00ff;">"c#" </span><span style="color:#000000;">runat=</span><span style="color:#2a00ff;">"server"</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">Page_Load</span><span style="color:#000000;">(</span><span style="color:#000000;">object source, EventArgs e</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">!</span><span style="color:#000000;">(</span><span style="color:#000000;">IsPostBack</span><span style="color:#000000;">))</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">MyButton.Text = </span><span style="color:#2a00ff;">"Save Cookie"</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">MyDropDownList.Items.Add</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Blue"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">MyDropDownList.Items.Add</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Red"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">MyDropDownList.Items.Add</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Gray"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">Click</span><span style="color:#000000;">(</span><span style="color:#000000;">object sender, EventArgs e</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">HttpCookie MyCookie = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">HttpCookie</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Background"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">MyCookie.Value = MyDropDownList.SelectedItem.Text;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">Response.Cookies.Add</span><span style="color:#000000;">(</span><span style="color:#000000;">MyCookie</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">}</span></code></p>
<p><span style="color:#000000;">&lt;/script&gt;</span></p>
<p><span style="color:#000000;">&lt;</span><span style="color:#7f0055;"><strong>html</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;</span><span style="color:#7f0055;"><strong>body</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;</span><span style="color:#7f0055;"><strong>form </strong></span><span style="color:#000000;">id=</span><span style="color:#2a00ff;">&#8220;CookieForm&#8221; </span><span style="color:#000000;">method=</span><span style="color:#2a00ff;">&#8220;post&#8221; </span><span style="color:#000000;">runat=</span><span style="color:#2a00ff;">&#8220;server&#8221;</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;asp:DropDownList id=MyDropDownList runat=</span><span style="color:#2a00ff;">&#8220;server&#8221;</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;asp:button id=MyButton runat=</span><span style="color:#2a00ff;">&#8220;server&#8221; </span><span style="color:#000000;">OnClick=</span><span style="color:#2a00ff;">&#8220;Click&#8221;</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;/</span><span style="color:#7f0055;"><strong>form</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;/</span><span style="color:#7f0055;"><strong>body</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#000000;">&lt;/</span><span style="color:#7f0055;"><strong>html</strong></span><span style="color:#000000;">&gt;</span></p>
<p><span style="color:#3f7f5f;">///////////////////////////////////////////////////</span></p>
<p><span style="color:#000000;">&lt;%@ Page Language=</span><span style="color:#2a00ff;">&#8220;c#&#8221; </span><span style="color:#000000;">%&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;script Language=</span><span style="color:#2a00ff;">&#8220;c#&#8221; </span><span style="color:#000000;">runat=</span><span style="color:#2a00ff;">&#8220;server&#8221;</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">Page_Load</span><span style="color:#000000;">(</span><span style="color:#000000;">object source, EventArgs e</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">Response.Cache.SetExpires</span><span style="color:#000000;">(</span><span style="color:#000000;">DateTime.Now</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">string GetBackground</span><span style="color:#000000;">()</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">Request.Cookies</span><span style="color:#000000;">[</span><span style="color:#2a00ff;">"Background"</span><span style="color:#000000;">]</span><span style="color:#000000;">.Value;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;/script&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;</span><span style="color:#7f0055;"><strong>html</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;</span><span style="color:#7f0055;"><strong>body </strong></span><span style="color:#000000;">bgcolor=</span><span style="color:#2a00ff;">&#8220;&lt;% Response.Write(GetBackground()); %&gt;&#8221;</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;asp:label id=</span><span style="color:#2a00ff;">&#8220;message&#8221; </span><span style="color:#000000;">runat=</span><span style="color:#2a00ff;">&#8220;server&#8221; </span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;/</span><span style="color:#7f0055;"><strong>body</strong></span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;"> </span><span style="color:#000000;">&lt;/</span><span style="color:#7f0055;"><strong>html</strong></span><span style="color:#000000;">&gt;</span></p>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=75&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/07/13/save-and-retrieve-values-in-cookie-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
		<item>
		<title>String Format for DateTime [C#]</title>
		<link>http://ocpmunir.wordpress.com/2010/07/12/string-format-for-datetime-c/</link>
		<comments>http://ocpmunir.wordpress.com/2010/07/12/string-format-for-datetime-c/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 10:24:18 +0000</pubDate>
		<dc:creator>ocpmunir</dc:creator>
				<category><![CDATA[Asp.Net]]></category>

		<guid isPermaLink="false">http://ocpmunir.wordpress.com/?p=73</guid>
		<description><![CDATA[This example shows how to format DateTime using String.Format method. All formatting can be done also using DateTime.ToString method. Custom DateTime Formatting There are following custom format specifiers y (year), M (month), d (day), h (hour 12), H (hour 24), m (minute), s (second), f (second fraction), F (second fraction, trailing zeroes are trimmed), t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=73&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This example shows how to format <a href="http://msdn2.microsoft.com/en-us/library/system.datetime.aspx">DateTime</a> using <a href="http://msdn2.microsoft.com/en-us/library/system.string.format.aspx">String.Format</a> method. All formatting can be done also using <a href="http://msdn2.microsoft.com/en-us/library/zdtaw1bw.aspx">DateTime.ToString</a> method.</p>
<h2>Custom DateTime Formatting</h2>
<p>There are following custom format specifiers <code>y</code> (year), <code>M</code> (month), <code>d</code> (day), <code>h</code> (hour 12), <code>H</code> (hour 24), <code>m</code> (minute), <code>s</code> (second), <code>f</code> (second fraction), <code>F</code> (second fraction,  trailing zeroes are trimmed), <code>t</code> (P.M or A.M) and <code>z</code> (time zone).</p>
<p>Following examples demonstrate how are the format specifiers  rewritten to the output.</p>
<p>[C#]</p>
<pre>// create date time 2008-03-09 16:05:07.123
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);

String.Format("{0:y yy yyy yyyy}", dt);  // "8 08 008 2008"   year
String.Format("{0:M MM MMM MMMM}", dt);  // "3 03 Mar March"  month
String.Format("{0:d dd ddd dddd}", dt);  // "9 09 Sun Sunday" day
String.Format("{0:h hh H HH}",     dt);  // "4 04 16 16"      hour 12/24
String.Format("{0:m mm}",          dt);  // "5 05"            minute
String.Format("{0:s ss}",          dt);  // "7 07"            second
String.Format("{0:f ff fff ffff}", dt);  // "1 12 123 1230"   sec.fraction
String.Format("{0:F FF FFF FFFF}", dt);  // "1 12 123 123"    without zeroes
String.Format("{0:t tt}",          dt);  // "P PM"            A.M. or P.M.
String.Format("{0:z zz zzz}",      dt);  // "-6 -06 -06:00"   time zone
</pre>
<p>You can use also <strong>date separator</strong> <code>/</code> (slash) and <strong>time sepatator</strong> <code>:</code> (colon). These characters  will be rewritten to characters defined in the current <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.dateseparator.aspx">DateTimeForma­tInfo.DateSepa­rator</a> and <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.timeseparator.aspx">DateTimeForma­tInfo.TimeSepa­rator</a>.</p>
<p>[C#]</p>
<pre>// date separator in german culture is "." (so "/" changes to ".")
String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9/3/2008 16:05:07" - english (en-US)
String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9.3.2008 16:05:07" - german (de-DE)
</pre>
<p>Here are some examples of custom date and time formatting:</p>
<p>[C#]</p>
<pre>// month/day numbers without/with leading zeroes
String.Format("{0:M/d/yyyy}", dt);            // "3/9/2008"
String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"

// day/month names
String.Format("{0:ddd, MMM d, yyyy}", dt);    // "Sun, Mar 9, 2008"
String.Format("{0:dddd, MMMM d, yyyy}", dt);  // "Sunday, March 9, 2008"

// two/four digit year
String.Format("{0:MM/dd/yy}", dt);            // "03/09/08"
String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"
</pre>
<h2>Standard DateTime Formatting</h2>
<p>In <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx">DateTimeForma­tInfo</a> there are defined standard patterns for the current culture. For example property <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.shorttimepattern.aspx">ShortTimePattern</a> is string that contains value <code>h:mm tt</code> for <strong>en-US</strong> culture and value <code>HH:mm</code> for <strong>de-DE</strong> culture.</p>
<p>Following table shows patterns defined in <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx">DateTimeForma­tInfo</a> and their values for en-US culture. First column contains format  specifiers for the <a href="http://msdn2.microsoft.com/en-us/library/system.string.format.aspx">String.Format</a> method.</p>
<table>
<tbody>
<tr>
<th>Specifier</th>
<th>DateTimeFormatInfo property</th>
<th>Pattern value (for en-US culture)</th>
</tr>
<tr>
<td><code>t</code></td>
<td>ShortTimePattern</td>
<td><code>h:mm tt</code></td>
</tr>
<tr>
<td><code>d</code></td>
<td>ShortDatePattern</td>
<td><code>M/d/yyyy</code></td>
</tr>
<tr>
<td><code>T</code></td>
<td>LongTimePattern</td>
<td><code>h:mm:ss tt</code></td>
</tr>
<tr>
<td><code>D</code></td>
<td>LongDatePattern</td>
<td><code>dddd, MMMM dd, yyyy</code></td>
</tr>
<tr>
<td><code>f</code></td>
<td><em>(combination of <code>D</code> and <code>t</code>)</em></td>
<td><code>dddd, MMMM dd, yyyy h:mm tt</code></td>
</tr>
<tr>
<td><code>F</code></td>
<td>FullDateTimePattern</td>
<td><code>dddd, MMMM dd, yyyy h:mm:ss tt</code></td>
</tr>
<tr>
<td><code>g</code></td>
<td><em>(combination of <code>d</code> and <code>t</code>)</em></td>
<td><code>M/d/yyyy h:mm tt</code></td>
</tr>
<tr>
<td><code>G</code></td>
<td><em>(combination of <code>d</code> and <code>T</code>)</em></td>
<td><code>M/d/yyyy h:mm:ss tt</code></td>
</tr>
<tr>
<td><code>m</code>, <code>M</code></td>
<td>MonthDayPattern</td>
<td><code>MMMM dd</code></td>
</tr>
<tr>
<td><code>y</code>, <code>Y</code></td>
<td>YearMonthPattern</td>
<td><code>MMMM, yyyy</code></td>
</tr>
<tr>
<td><code>r</code>, <code>R</code></td>
<td>RFC1123Pattern</td>
<td><code>ddd, dd MMM yyyy HH':'mm':'ss 'GMT'</code> <em>(*)</em></td>
</tr>
<tr>
<td><code>s</code></td>
<td>SortableDateTi­mePattern</td>
<td><code>yyyy'-'MM'-'dd'T'HH':'mm':'ss</code> <em>(*)</em></td>
</tr>
<tr>
<td><code>u</code></td>
<td>UniversalSorta­bleDateTimePat­tern</td>
<td><code>yyyy'-'MM'-'dd HH':'mm':'ss'Z'</code> <em>(*)</em></td>
</tr>
<tr>
<td></td>
<td></td>
<td><em>(*) = culture independent</em></td>
</tr>
</tbody>
</table>
<p>Following examples show usage of <strong>standard format specifiers</strong> in <a href="http://msdn2.microsoft.com/en-us/library/system.string.format.aspx">String.Format</a> method and the resulting output.</p>
<p>[C#]</p>
<pre>String.Format("{0:t}", dt);  // "4:05 PM"                         ShortTime
String.Format("{0:d}", dt);  // "3/9/2008"                        ShortDate
String.Format("{0:T}", dt);  // "4:05:07 PM"                      LongTime
String.Format("{0:D}", dt);  // "Sunday, March 09, 2008"          LongDate
String.Format("{0:f}", dt);  // "Sunday, March 09, 2008 4:05 PM"  LongDate+ShortTime
String.Format("{0:F}", dt);  // "Sunday, March 09, 2008 4:05:07 PM" FullDateTime
String.Format("{0:g}", dt);  // "3/9/2008 4:05 PM"                ShortDate+ShortTime
String.Format("{0:G}", dt);  // "3/9/2008 4:05:07 PM"             ShortDate+LongTime
String.Format("{0:m}", dt);  // "March 09"                        MonthDay
String.Format("{0:y}", dt);  // "March, 2008"                     YearMonth
String.Format("{0:r}", dt);  // "Sun, 09 Mar 2008 16:05:07 GMT"   RFC1123
String.Format("{0:s}", dt);  // "2008-03-09T16:05:07"             SortableDateTime
String.Format("{0:u}", dt);  // "2008-03-09 16:05:07Z"            UniversalSortableDateTime
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ocpmunir.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ocpmunir.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ocpmunir.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ocpmunir.wordpress.com&amp;blog=10025641&amp;post=73&amp;subd=ocpmunir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ocpmunir.wordpress.com/2010/07/12/string-format-for-datetime-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a1c4ef5f11975b8f5c57cdb10f784a94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ocpmunir</media:title>
		</media:content>
	</item>
	</channel>
</rss>
