<?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>Sunilyadav&#039;s Blog</title>
	<atom:link href="http://sunilyadav.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunilyadav.wordpress.com</link>
	<description>Coding,Cricket,Cheers!!!!!</description>
	<lastBuildDate>Thu, 10 Dec 2009 12:38:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sunilyadav.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d3319974ce43e1613aa145f04fa9ff9c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Sunilyadav&#039;s Blog</title>
		<link>http://sunilyadav.wordpress.com</link>
	</image>
			<item>
		<title>Add user  to SharePoint Sites using stsadm command</title>
		<link>http://sunilyadav.wordpress.com/2009/12/10/add-user-to-sharepoint-sites-using-stsadm-command/</link>
		<comments>http://sunilyadav.wordpress.com/2009/12/10/add-user-to-sharepoint-sites-using-stsadm-command/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 08:50:34 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=183</guid>
		<description><![CDATA[Following is the way to add user to sharepoint site using stsadm command.
stsadm -o adduser -url http://mossportal:2020 -userlogin Username -useremail user1234@domain.com -group “Farm Administrators” -username “Administrators”
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=183&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Following is the way to add user to sharepoint site using stsadm command.</p>
<blockquote><p>stsadm -o adduser -url http://mossportal:2020 -userlogin Username -useremail user1234@domain.com -group “Farm Administrators” -username “Administrators”</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=183&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/12/10/add-user-to-sharepoint-sites-using-stsadm-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>File exist error in sharepoint.</title>
		<link>http://sunilyadav.wordpress.com/2009/12/10/file-exist-error-in-sharepoint/</link>
		<comments>http://sunilyadav.wordpress.com/2009/12/10/file-exist-error-in-sharepoint/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 06:44:10 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[file exist sharepoint]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=170</guid>
		<description><![CDATA[Recently i came across an issue when I tried to login to my SharePoint intranet portal. 
 The file exists. (Exception from HRESULT: 0×80070050).
 After playing around it for around 3-4 hours I got the solution.
This error occurred when I moved my local system to the domain. When you moved your local system to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=170&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently i came across an issue when I tried to login to my SharePoint intranet portal. </p>
<blockquote><p> The file exists. (Exception from HRESULT: 0×80070050).</p></blockquote>
<p> After playing around it for around 3-4 hours I got the solution.<br />
This error occurred when I moved my local system to the domain. When you moved your local system to the domain, all the local user policy is replaced by domain user policy. In my case local administrator account was deleted which doesn’t happens generally. This can also happen when you delete the account which is used during SharePoint installation. It’s bad idea to move your machine on domain after installing SharePoint server or deleting user account responsible for installing SharePoint. </p>
<blockquote><p>One common mistake made when installing SharePoint for the first time, is using a personal administrator account when installing.  The reason for not wanting to use a personal administrator account is the account used when installing SharePoint is given special rights on the server.  It has been found in extreme instances of troubleshooting that the only account able to complete the configuration wizard to detach from a corrupted farm is the account initially used to install SharePoint.  To avoid this issue, a SharePoint Admin account can be created and used for installations. Prior to installation, this account should be given administrator rights on all SharePoint servers and should be given the SQL Server dbcreator and securityadmin roles. The minimalist approach involves creating two accounts, one to run and manage SharePoint and the other to manage Search.</p></blockquote>
<p>Since the account has not sufficient rights (db owner) on the database named &#8220;WSS_Content&#8221; and &#8220;Admin_content&#8221;.<br />
We need to add user to the &#8220;WSS_Content&#8221; and &#8220;Admin_content&#8221; databases in SQL with DB_Owner and Security Admin roles.</p>
<blockquote><p>sp_addrolemember &#8216;db_owner&#8217;,'Username&#8217;<br />
sp_addrolemember &#8216;db_securityadmin&#8217;,'Username&#8217;</p></blockquote>
<p>Also we need to add user to the sharepoint site.</p>
<blockquote><p>stsadm -o adduser -url http://mossportal:2020 -userlogin Username -useremail user1234@domain.com -group “Farm Administrators” -username “Administrators”</p></blockquote>
<p>When you install windows server 2003/2008, Windows generate SID for users and assign unique SID for them. When you install SharePoint on your machine, SharePoint adds user&#8217;s information like SID, user&#8217;s Site ID, and permissions in the SharePoint database. Also when browsing site SharePoint users SID and SID stores in database are compared and based on this it authorizes user. Since both SID’s were different it is likely that SharePoint will be affected. We cannot change SID for the user so we have to change SID stored in the database.<br />
Following is the way to change/update the SID stored in the database.<br />
Select the database which needs to be update SID entry. In my case it was in <strong>Wss_content</strong> and <strong>SharePoint_AdminContent</strong>.<br />
Here you will get all user related information on selected database.</p>
<blockquote><p>SELECT *<br />
FROM UserInfo<br />
WHERE tp_Login=&#8217;username&#8217;</p></blockquote>
<p>‘username’ is user account which got deleted.<br />
Above query shows SID for selected username. Now we need to find SID for the same user in the Windows and replace it with database SID. You can use PStools utility and execute the command on command prompt “Psgetsid username“to get user SID.<br />
This command&#8217;s result for my machine shown in image:<br />
For example my administrator&#8217;s SID is:<br />
S-1-5-21-1422252240-1001139268-3133179427<br />
Here we need to convert SID into hex format as follows:</p>
<blockquote><p>0x =0x<br />
S-1=01<br />
5 = 0×000000000005=000000000005<br />
21 =15000000<br />
1422252240=D0D8C554  (hexadecimal of 1422252240=54C5D8D0 and little endian of 54C5D8D0=D0D8C554)<br />
1001139268=442CAC3B  (same way as above)<br />
3133179427=2386C0BA  (same way as above)<br />
500=F4010000 (same as above)<br />
And Hex format of SID:<br />
0×010500000000000515000000D0D8C554442CAC3B2386C0BAF4010000</p></blockquote>
<p>Now you should to update database table with new SID. Run the following query in sql server management studio.</p>
<blockquote><p>UPDATE UserInfo SET tp_SystemID = cast(&#8216;0×0105000000000005150000000D8D5C4544C2CAB332680CABF4010000&#8242; as varbinary)  FROM UserInfo WHERE tp_ID = &#8216;1&#8242; tp_Login=&#8217;username&#8217; and tp_SiteID =&#8217;FDDA95A1-3B15-46B5-801C-2101ACC6B7F8&#8242;</p></blockquote>
<p>That’s all …..Your site should now up and running.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=170&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/12/10/file-exist-error-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>The search request was unable to connect to the Search Service</title>
		<link>http://sunilyadav.wordpress.com/2009/12/09/the-search-request-was-unable-to-connect-to-the-search-service/</link>
		<comments>http://sunilyadav.wordpress.com/2009/12/09/the-search-request-was-unable-to-connect-to-the-search-service/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 09:39:11 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint Search]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=164</guid>
		<description><![CDATA[Recently i came across the issue &#8220;The search request was unable to connect to the Search Service&#8221;.
After the usual troubleshooting i found solution.There are many solution
1.Go to Start
2.select Run
3.Type in &#8220;Services.msc&#8221;
4.In the services console check wheather Windows SharePoint Services Search(ONLY IF THAT SERVER IS MANAGING YOUR SEARCH)  is running.
1.Goto Computer management
2.Select Services and applications
3.Start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=164&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently i came across the issue <em>&#8220;The search request was unable to connect to the Search Service&#8221;.</em></p>
<p>After the usual troubleshooting i found solution.There are many solution</p>
<blockquote><p>1.Go to Start<br />
2.select Run<br />
3.Type in &#8220;Services.msc&#8221;<br />
4.In the services console check wheather Windows SharePoint Services Search(ONLY IF THAT SERVER IS MANAGING YOUR SEARCH)  is running.</p></blockquote>
<blockquote><p>1.Goto Computer management<br />
2.Select Services and applications<br />
3.Start indexing service.</p></blockquote>
<blockquote><p>Restart &#8220;Office SharePoint Server Search(ONLY IF THAT SERVER IS MANAGING YOUR SEARCH) &#8221; and &#8220;Windows SharePoint Services Search (ONLY IF THAT SERVER IS MANAGING YOUR SEARCH) &#8221; Windows Services</p></blockquote>
<blockquote><p>1.Go to Operations tab in Central Administration<br />
2.Select &#8220;Services on Server&#8221; from Topology and Services<br />
3.Select your Indexing/application Server from the server menu and make sure &#8220;Office SharePoint Server Search&#8221; and &#8220;Windows SharePoint Services Search&#8221; services are started.</p></blockquote>
<blockquote><p>1.Go to Central Administration </p>
<p>2.Select Operations Tab </p>
<p>3.Select Services on Server </p>
<p>4.check whether Office Share Point Server Search is started.</p></blockquote>
<blockquote><p>Search the Application Pool that is using Microsoft SharePoint Server, change<br />
the permissions from Network Services to an account that having sufficient<br />
privileges to access the SQL Database.</p>
<p>Another possible resolution could be that the user who is configured to run the search has not the required permissions. So check the user permission on the SQL Database. And if your SQL Server is running under Mixed Mode Authentication. </p></blockquote>
<blockquote><p>When the Index and Query roles are installed on different Web servers, check whether for ports of index and query servers are opened.</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=164&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/12/09/the-search-request-was-unable-to-connect-to-the-search-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Failed to register SharePoint Services</title>
		<link>http://sunilyadav.wordpress.com/2009/11/09/failed-to-register-sharepoint-services/</link>
		<comments>http://sunilyadav.wordpress.com/2009/11/09/failed-to-register-sharepoint-services/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:44:30 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=149</guid>
		<description><![CDATA[Recently When I was trying to run Configuration Sharepoint Product and Technologies after successful installation of MOSS 2007 sp1, I was getting  error &#8220;Failed to register SharePoint Services&#8221;.After googling for more than 1 hour i found solution.
Solution.
1. Open regedit.
2. In the Registry Editor, navigate to the following subkey &#8220;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\Services&#8221; and delete [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=149&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently When I was trying to run Configuration Sharepoint Product and Technologies after successful installation of MOSS 2007 sp1, I was getting  error &#8220;Failed to register SharePoint Services&#8221;.After googling for more than 1 hour i found solution.</p>
<p>Solution.</p>
<blockquote><p>1. Open regedit.</p>
<p>2. In the Registry Editor, navigate to the following subkey <strong>&#8220;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\Services&#8221;</strong> and delete the entry <strong>&#8220;Microsoft.Office.Server.Search.Administration.SearchService&#8221;.</strong></p>
<p>3. Run the SharePoint Products and Technologies Configuration Wizard again.
</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=149&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/11/09/failed-to-register-sharepoint-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Create or extend Web application option missing from SharePoint Central Administration site</title>
		<link>http://sunilyadav.wordpress.com/2009/11/09/create-or-extend-web-application-option-missing-from-sharepoint-central-administration-site/</link>
		<comments>http://sunilyadav.wordpress.com/2009/11/09/create-or-extend-web-application-option-missing-from-sharepoint-central-administration-site/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 06:35:32 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=140</guid>
		<description><![CDATA[Recently I wanted to create a new web application in SharePoint 2007 and so I went to the Central Administration site to create one, but the option &#8220;Create or extend Web application&#8221; was missing.So after playing around it for 2-3 hours i notice the cause of the problem.It was permission related issue.
So i run  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=140&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I wanted to create a new web application in SharePoint 2007 and so I went to the Central Administration site to create one, but the option &#8220;Create or extend Web application&#8221; was missing.So after playing around it for 2-3 hours i notice the cause of the problem.It was permission related issue.<br />
So i run  “Central Administration” site with administrator privileges (run Internet Explorer as Administrator) .Also i have added to “Central Administration” site to the intranet zone.<br />
Now, I am able to see the &#8220;Create or extend Web application&#8221; options.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=140&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/11/09/create-or-extend-web-application-option-missing-from-sharepoint-central-administration-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Modifying Created By and Modified By column in sharepoint list</title>
		<link>http://sunilyadav.wordpress.com/2009/10/23/modifying-created-by-and-modified-by-column-in-sharepoint-list/</link>
		<comments>http://sunilyadav.wordpress.com/2009/10/23/modifying-created-by-and-modified-by-column-in-sharepoint-list/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 12:06:55 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=122</guid>
		<description><![CDATA[Created by and Modified By are system default columns.You cannot directly edit Created by or Modified By column in sharepoint out of box. All you need to do is make the column display in your view
Following is one of the way to modify these two columns..

SPSite site = new SPSite(&#34;http://intranet&#34;);
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=122&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Created by and Modified By are system default columns.You cannot directly edit Created by or Modified By column in sharepoint out of box. All you need to do is make the column display in your view</p>
<p>Following is one of the way to modify these two columns..</p>
<pre class="brush: csharp;">
SPSite site = new SPSite(&quot;http://intranet&quot;);
SPWeb web = site.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList list = web.Lists[&quot;User Details&quot;];
SPListItemCollection collection = list.Items;
foreach (SPListItem item in collection)
{
SPUser user = web.EnsureUser(@&quot;intranet\Administrator&quot;);
item[&quot;Created By&quot;] = @&quot;intranet\sunil&quot;; // Created By field
item.Update();
}
list.Update();
web.Update();
web.Close();</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=122&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/10/23/modifying-created-by-and-modified-by-column-in-sharepoint-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Developing Sequential Workflow In ASP.Net Applications</title>
		<link>http://sunilyadav.wordpress.com/2009/10/16/developing-sequential-workflow-in-asp-net-applications/</link>
		<comments>http://sunilyadav.wordpress.com/2009/10/16/developing-sequential-workflow-in-asp-net-applications/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 12:10:43 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=38</guid>
		<description><![CDATA[In this article i am going to explain how to create sequential workflow in asp.net.
step:1 -&#62;;; Create New Sequential Workflow Project
Open Visual Studio 2008 &#8211;&#62;; create a new project&#8211;&#62;; Choose  Sequential Workflow Library
at this point,the workflow project contains single workflow class(workflow1).
step:2 -&#62;;  Drag a IfElse activity onto the design surface from  the toolbox.The designer looks like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=38&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this article i am going to explain how to create sequential workflow in asp.net.</p>
<p>step:1 -&gt;;; Create New Sequential Workflow Project</p>
<p>Open Visual Studio 2008 &#8211;&gt;; create a new project&#8211;&gt;; Choose  Sequential Workflow Library</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 310px"><a href="http://sunilyadav.files.wordpress.com/2009/10/wwf_1.jpg"><img class="size-medium wp-image-95" src="http://sunilyadav.files.wordpress.com/2009/10/wwf_1.jpg?w=300&#038;h=218" alt="New Workflow" width="300" height="218" /></a><p class="wp-caption-text">New Workflow</p></div>
<p>at this point,the workflow project contains single workflow class(workflow1).</p>
<p>step:2 -&gt;;  Drag a IfElse activity onto the design surface from  the toolbox.The designer looks like below figure below.</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 310px"><a href="http://sunilyadav.files.wordpress.com/2009/10/wwf_5.jpg"><img class="size-medium wp-image-95" src="http://sunilyadav.files.wordpress.com/2009/10/wwf_5.jpg?w=300&#038;h=218" alt="" width="300" height="218" /></a><p class="wp-caption-text">New Workflow</p></div>
<p>Note that while dragging activity on the surface you will see  green (+ sign) which indicates a place where you can drop activity.(you can also refer figure below).<br />
step:3 -&gt; Drop Code activity inside ifElseBranchActivity1 and ifElseBranchActivity2 and name them as Authorized and UnAuthorized respectively.</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 310px"><a href="http://sunilyadav.files.wordpress.com/2009/10/wwf_6.jpg"><img class="size-medium wp-image-95" src="http://sunilyadav.files.wordpress.com/2009/10/wwf_6.jpg?w=300&#038;h=218" alt="" width="300" height="218" /></a><p class="wp-caption-text">New Workflow</p></div>
<p>step:4 -&gt; set the Condition on ifElseBranchActivity1 to  code condition and set the condition property to IsAuthorized.</p>
<pre class="brush: csharp;">
private void IsAuthorized(object sender, ConditionalEventArgs e)
{
if (UserName == &quot;sunil&quot; &amp;amp;&amp;amp; Password == &quot;demo@123&quot;)
{
this.Result = &quot;Welcome.aspx&quot;;
}
else
{
this.Result = &quot;NotAuthorized.aspx&quot;;
}
}
</pre>
<p>Also create following to accept parameter value..</p>
<pre class="brush: csharp;">
public string UserName { get; set; }
public string Password { get; set; }
public string Result { get; set; }
</pre>
<p>step:5 -&gt;; Create asp.net application in the solution, add to more page Welcome.aspx and UnAuthorized.aspx i the application as shown below</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 310px"><a href="http://sunilyadav.files.wordpress.com/2009/10/wwf_91.jpg"><img class="size-medium wp-image-95" src="http://sunilyadav.files.wordpress.com/2009/10/wwf_91.jpg?w=300&#038;h=218" alt="" width="300" height="218" /></a><p class="wp-caption-text">New Workflow</p></div>
<p>Write down the following code on Login_Click.</p>
<pre class="brush: csharp;">
protected void Login_Click(object sender, EventArgs e)
{
WorkflowRuntime wr = new WorkflowRuntime();

wr.AddService(new ManualWorkflowSchedulerService());
Dictionary parameters = new Dictionary();
parameters.Add(&quot;Result&quot;, &quot;&quot;);
parameters.Add(&quot;UserName&quot;, txtUserName.Text);
parameters.Add(&quot;Password&quot;, txtPassword.Text);
wr.WorkflowCompleted += new EventHandler(wfRuntime_WorkflowCompleted);
WorkflowInstance wi = wr.CreateWorkflow(typeof(SequentialWorkflowDemo.Workflow1), parameters);
wi.Start();
ManualWorkflowSchedulerService ss = wr.GetService();
ss.RunWorkflow(wi.InstanceId);
}
</pre>
<p>also following line of code to redirect user to specific page.</p>
<pre class="brush: csharp;">
void wfRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
{
HttpContext.Current.Response.Redirect((string)e.OutputParameters[&quot;Result&quot;]);
}
</pre>
<p>Your workflow application is ready to execute.Run your asp.net application.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=38&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/10/16/developing-sequential-workflow-in-asp-net-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>

		<media:content url="http://sunilyadav.files.wordpress.com/2009/10/wwf_1.jpg?w=300" medium="image">
			<media:title type="html">New Workflow</media:title>
		</media:content>

		<media:content url="http://sunilyadav.files.wordpress.com/2009/10/wwf_5.jpg?w=300" medium="image" />

		<media:content url="http://sunilyadav.files.wordpress.com/2009/10/wwf_6.jpg?w=300" medium="image" />

		<media:content url="http://sunilyadav.files.wordpress.com/2009/10/wwf_91.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Http handlers to handle images</title>
		<link>http://sunilyadav.wordpress.com/2009/09/04/http-handlers-to-handle-images/</link>
		<comments>http://sunilyadav.wordpress.com/2009/09/04/http-handlers-to-handle-images/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 20:34:32 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[creating thumbnail images using http handler]]></category>
		<category><![CDATA[Http Handler for images]]></category>
		<category><![CDATA[HttpHandler]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=29</guid>
		<description><![CDATA[In this article i am going to create a Http Handler which will be used to resize images .
What are HTTP Handler

HTTP handlers are the .NET components that implement the System.Web.IHttpHandler interface, they can act as a target for the incoming HTTP requests and can be called directly by using their file name in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=29&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this article i am going to create a <strong>Http Handler </strong>which will be used to resize images .</p>
<p><strong>What are HTTP Handler<br />
</strong><br />
HTTP handlers are the .NET components that implement the <strong>System.Web.IHttpHandler</strong> interface, they can act as a target for the incoming HTTP requests and can be called directly by using their file name in the URL.<br />
HTTP handlers implement the following two methods:<br />
1) <strong>ProcessRequest</strong>: called to process http requests and<br />
2) <strong>IsReusable</strong> which indicates whether this instance of http handler can be reused for fulfilling another requests of the same type.</p>
<p>Right click on your website&#8211;&gt; Add new Item&#8211;&gt; Generic Handler and name it as ImageHandler.ashx</p>
<p>Here is <strong>ImageHandler.ashx</strong> file</p>
<pre class="brush: csharp;">
&lt;%@ WebHandler Language=&quot;C#&quot; %&gt;

using System;
using System.Web;
using System.IO;

public class ImageHandler : IHttpHandler
{
 public void ProcessRequest(HttpContext context)
{
string sImageFileName = &quot;&quot;;
int iThumbSize = 0;
decimal dHeight, dWidth, dNewHeight, dNewWidth;

sImageFileName = context.Request.QueryString[&quot;img&quot;];
iThumbSize = Convert.ToInt32(context.Request.QueryString[&quot;sz&quot;]);&lt;/span&gt;&lt;/p&gt;
System.Drawing.Image objImage = System.Drawing.Bitmap.FromFile(System.Web.HttpContext.Current.Server.MapPath(&quot;Image Path&quot; + sImageFileName));
if (sImageFileName != null)
{
if (iThumbSize == 1)
{
dHeight = objImage.Height;
dWidth = objImage.Width;
dNewHeight = 120;
dNewWidth = dWidth * (dNewHeight / dHeight);
objImage = objImage.GetThumbnailImage((int)dNewWidth, (int)dNewHeight, new System.Drawing.Image.GetThumbnailImageAbort(callback), new IntPtr());
}
if (iThumbSize == 2)
{
dHeight = objImage.Height;
dWidth = objImage.Width;
dNewHeight = 200;
dNewWidth = dWidth * (dNewHeight / dHeight);
objImage = objImage.GetThumbnailImage((int)dNewWidth, (int)dNewHeight, new System.Drawing.Image.GetThumbnailImageAbort(callback), new IntPtr());
}

MemoryStream objMemoryStream = new MemoryStream();
objImage.Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageContent = new byte[objMemoryStream.Length];
objMemoryStream.Position = 0;
objMemoryStream.Read(imageContent, 0, (int)objMemoryStream.Length);
context.Response.ContentType = &quot;image/jpeg&quot;;
context.Response.BinaryWrite(imageContent);
}
}
 private bool callback()
{
return true;
}
public bool IsReusable
{
get
{
return false;
}
}

}
</pre>
<p>Following is the way to write it..</p>
<pre class="brush: xml;">
&lt;img id=&quot;Image1&quot;  src='../ImageHandler.ashx?img=ImageName&amp;amp;sz=1' /&gt;
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=29&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/09/04/http-handlers-to-handle-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Why to use StoredProcedures ?</title>
		<link>http://sunilyadav.wordpress.com/2009/04/15/why-to-use-storedprocedures/</link>
		<comments>http://sunilyadav.wordpress.com/2009/04/15/why-to-use-storedprocedures/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 08:25:26 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[SQL Server 2005/08]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=18</guid>
		<description><![CDATA[Stored Procedures can be reused from different webpages, classes or webapplication where in case of coding sql statements you have to write code in each and every place.
Stored Procedures uses parameters to receive user input values so helps to  prevent SQL injection.
Stored procedure are in complied form i.e they are already in compiled mode [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=18&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Stored Procedures can be reused from different webpages, classes or webapplication where in case of coding sql statements you have to write code in each and every place.</p>
<p>Stored Procedures uses parameters to receive user input values so helps to  prevent SQL injection.</p>
<p>Stored procedure are in complied form i.e they are already in compiled mode you nedd need to call them in your application. wherein when you write sql query the processor has to parse it, analyze it and  execute it. so the stored procedure are faster than coding sql queries.</p>
<p>Stored Procedures are easy to debug.</p>
<p>Also from security point of view we can provide credentials to execute the stored procedure so this means that  users access to the database can be defined by only allowing them permissions to execute the allowed stored procedures while denying them permissions to the underlying database objects such as tables and views that are used by the stored procedures.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=18&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/04/15/why-to-use-storedprocedures/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
		<item>
		<title>Logging Errors and Exceptions in ASP.NET 2.0</title>
		<link>http://sunilyadav.wordpress.com/2009/04/12/logging-errors-and-exceptions-in-aspnet-20/</link>
		<comments>http://sunilyadav.wordpress.com/2009/04/12/logging-errors-and-exceptions-in-aspnet-20/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 03:38:47 +0000</pubDate>
		<dc:creator>Sunil Yadav</dc:creator>
				<category><![CDATA[ASP.Net]]></category>

		<guid isPermaLink="false">http://sunilyadav.wordpress.com/?p=14</guid>
		<description><![CDATA[In this article i am going to use simple class which use to write error and exceptions occured in your asp.net application in a text file format.
Below i have created a class Common in which there is function WriteToEventLog  which accepts Exception as parameter.



public class  Common

{

public static void WriteToEventLog(Exception exception)
{
string sPath = &#34;~/error/&#34; + [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=14&subd=sunilyadav&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this article i am going to use simple class which use to write error and exceptions occured in your asp.net application in a text file format.</p>
<p>Below i have created a class Common in which there is function <strong>WriteToEventLog </strong> which accepts Exception as parameter.<br />
<code><br />
</code></p>
<pre class="brush: csharp;">
public class  Common

{

public static void WriteToEventLog(Exception exception)
{
string sPath = &quot;~/error/&quot; + DateTime.Today.ToString(&quot;dd-mm-yy&quot;) + &quot;.txt&quot;;
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(sPath)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(sPath)).Close();
}

StreamWriter objStreamWriter = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(sPath));
{
objStreamWriter.WriteLine(&quot;\r\nLog Entry : &quot;);
objStreamWriter.WriteLine(&quot;{0}&quot;, DateTime.Now.ToString(CultureInfo.InvariantCulture));
string sError = &quot;Error in: &quot; + System.Web.HttpContext.Current.Request.Url.ToString() +
&quot;. Error Message:\n&quot; + exception.Message;
objStreamWriter.WriteLine(sError);
objStreamWriter.WriteLine(&quot;__________________________&quot;);
objStreamWriter.Flush();
objStreamWriter.Close();
}
}

}</pre>
<p>Now our class is ready you only need to call in your try catch body as shown below&#8230;</p>
<pre class="brush: csharp;">
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
if (User.HasUserLoggedIn())
{

UpdateTotal();
}
else
{
Response.Redirect(&quot;~/pages/MessagePage.aspx?ConfigValue=MsgUserNotLoggedIn&quot;, false);
}
}
}
catch (Exception ex)
{
Common.WriteToEventLog(ex);
}
}</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilyadav.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilyadav.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilyadav.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilyadav.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilyadav.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilyadav.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilyadav.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilyadav.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilyadav.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilyadav.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilyadav.wordpress.com&blog=6835032&post=14&subd=sunilyadav&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sunilyadav.wordpress.com/2009/04/12/logging-errors-and-exceptions-in-aspnet-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b30cdfdfc1c196af9c9a8ef0e4beb9a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sunilee</media:title>
		</media:content>
	</item>
	</channel>
</rss>