<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>finally{}</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/vkamat/Atom.aspx" />
    <subtitle type="html">My interactions with .Net and Web development - What's most important is what happens finally{}</subtitle>
    <id>http://geekswithblogs.net/vkamat/Default.aspx</id>
    <author>
        <name>Vinayak</name>
        <uri>http://geekswithblogs.net/vkamat/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2006-05-02T09:14:00Z</updated>
    <entry>
        <title>techEnvelope.com</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/05/02/76965.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/05/02/76965.aspx</id>
        <published>2006-05-02T09:13:00-05:00:00</published>
        <updated>2006-05-02T09:14:00Z</updated>
        <content type="html">Helo all,

I've migrated my blog to http://www.techenvelope.com/&lt;/br/&gt;

Posts about technology, code and more will continue there.&lt;br/&gt;

So update your bookmarks to &lt;a href="http://www.techenvelope.com/"&gt;&lt;b&gt;tech:Envelope&lt;/b&gt;&lt;/a&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/76965.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/76965.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/76965.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/76965.aspx</trackback:ping>
    </entry>
    <entry>
        <title>My experiences with Visual Studio.Net 2005</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/03/09/71883.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/03/09/71883.aspx</id>
        <published>2006-03-09T14:29:00-06:00:00</published>
        <updated>2006-03-09T15:02:00Z</updated>
        <content type="html">&lt;P&gt;In Visual Studio.Net 2005 things have changed quite a bit. For better. But for people who resist changes, they're gonna have some starting trouble. Like the following ones. For me. May be for you as well.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Problem 1:&lt;/STRONG&gt;&lt;BR&gt;I want to run my webservices under IIS, not on a developement server with some port (For ex: 4187) which kicks off while debugging (when you press F5).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt; &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Right click on the project (there's no really a project there in your solution explorer. Its just a directory structure like C:\...\MyWebSvc\) click Build site. 
&lt;LI&gt;Go to windows explorer right click on this directory (MywebSvc) web share it. Go to IIS, Go to the default web site -&amp;gt; MyWebSvc right click properties -&amp;gt; Remove application -&amp;gt; Create application. Say apply. Done. 
&lt;LI&gt;Now you can run &lt;A href="http://localhost/MyWebSvc/Service.asmx"&gt;http://localhost/MyWebSvc/Service.asmx&lt;/A&gt; and attach this as webreference to your other project (which uses the websvc) so that your other team members can use this websvc which is now setup on your machine. Make sure you change "localhost" to your machine name, when you web reference it in another project. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Ideally this is exactly what might have to be done on a production web server. I am not sure what the publish site does. Need to check it out though.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Problem 2:&lt;/STRONG&gt;&lt;BR&gt;As explained in the Solution above, I am not really comfortable with the idea of having a directory structure for WebSvc or ASP.Net website, without a .csproj.&lt;BR&gt;Can someone tell me what's the purpose and how better to get used to it?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Problem 3:&lt;/STRONG&gt;&lt;BR&gt;This is not completely related to VS.Net 2005 but still I would like to put it this way. I have a web service running on my machine, which talks to a SQL server db using windows authentication of my machine. When I run this websvc from my machine all goes fine. Now my other team members run this websvc from their machines, the SQL server login fails. Even I run it from my webbrowser (not in debug mode, not through the dummy dev server) it fails.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solution: &lt;BR&gt;&lt;/STRONG&gt;You have to impersonate the aspnet_wp worker process to use your windows authentication, which can be done by adding the following nodes to your web.config of the MyWebSvc.&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 12pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: ProggyCleanTT CE"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;!--&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: green"&gt;    The &lt;authentication&gt; section enables configuration &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: green"&gt;    of the security authentication mode used by &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: green"&gt;    ASP.NET to identify an incoming user. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;--&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;authentication&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;mode&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Windows&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;identity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;impersonate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;STRONG&gt;Problem 3.1:&lt;BR&gt;&lt;/STRONG&gt;Now with the above problem 3 solved, you have one more minor problem, when you run this websvc from IIS, you want to debug it. So you attach aspnet_wp.exe to your project in the visual studio. But just when you open the SQLConnection (SQLConnection.open), throws an exception&lt;BR&gt;[SqlException: EXECUTE permission denied on object 'sp_sdidebug', database&lt;BR&gt;'master', owner 'dbo'.] &lt;BR&gt;But, if you have handled this exception without rethrowing it, rest of the code works fine without a problem.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solution&lt;/STRONG&gt;:&lt;BR&gt;While attaching the aspnet_wp.exe process, just make sure you've changed the "Attach to:" to work on only "Managed code", just uncheck the "T-SQL code".&lt;BR&gt;Now you won't get an exception while debugging. Check out for &lt;A href="http://groups.google.com/group/microsoft.public.vsnet.debugging/browse_thread/thread/6af103add0922c47/9fd8b5f54d7ad96c?tvc=2&amp;amp;q=open+%2B+EXECUTE+permission+denied+on+object+'sp_sdidebug'%2C+database+'master'%2C+owner+'dbo'#9fd8b5f54d7ad96c"&gt;more&lt;/A&gt; info on this problem.&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/71883.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/71883.aspx</wfw:comment>
        <slash:comments>8</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/71883.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/71883.aspx</trackback:ping>
    </entry>
    <entry>
        <title>String replace in XSLT</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/03/01/71082.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/03/01/71082.aspx</id>
        <published>2006-03-01T08:45:00-06:00:00</published>
        <updated>2006-03-01T08:45:00Z</updated>
        <content type="html">&lt;P&gt;It is possible to do string manipulation like replace etc in XSLT as well. Javascript has str.replace right? So in XSLT you can do this by creating templates and by doing call-template.&lt;/P&gt;
&lt;P&gt;Follow this link for complete info and source code&lt;BR&gt;&lt;A href="http://www.dpawson.co.uk/xsl/sect2/StringReplace.html"&gt;http://www.dpawson.co.uk/xsl/sect2/StringReplace.html&lt;/A&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/71082.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/71082.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/71082.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/71082.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Getting a stream object from a MyJavascript(.js txtfile) - Resources</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/02/08/68708.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/02/08/68708.aspx</id>
        <published>2006-02-08T09:53:00-06:00:00</published>
        <updated>2006-02-08T09:54:00Z</updated>
        <content type="html">&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="COLOR: green"&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: green"&gt;// Getting a stream object from a MyJavascript(.js txtfile) in the Resources.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: green"&gt;// In VS-2005 &amp;gt; .Net 2.0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;objMyStream = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.IO.&lt;SPAN style="COLOR: teal"&gt;MemoryStream&lt;/SPAN&gt;(&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.Text.&lt;SPAN style="COLOR: teal"&gt;Encoding&lt;/SPAN&gt;.UTF8.GetBytes(&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Properties.&lt;SPAN style="COLOR: teal"&gt;Resources&lt;/SPAN&gt;.MyJavascriptFile));&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/68708.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/68708.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/68708.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/68708.aspx</trackback:ping>
    </entry>
    <entry>
        <title>LOTD # 1 : Check the InnerException</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/02/06/68410.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/02/06/68410.aspx</id>
        <published>2006-02-06T13:31:00-06:00:00</published>
        <updated>2006-02-06T13:31:00Z</updated>
        <content type="html">&lt;P&gt;Today, one of my teammate was getting a &lt;FONT color=#ff0000&gt;"TargetInvocationException" : Exception has been thrown by the target of an invocation&lt;/FONT&gt;. This reminded me of my 'initial learning curve'&amp;nbsp;days in .Net when I encountered this exception, and had a really hard time fixing this one. I can't remember how we(There were other team members who worked on this as well and it was back in 2002-03) solved it. &lt;/P&gt;
&lt;P&gt;The beauty of the problem is you wouldn't know why you are being thrown this one, inspite of things working as they should. &lt;/P&gt;
&lt;P&gt;The lesson learned is to do in-depth (F11) debugging and check for the InnerException when you catch it (always use try catch around potentially functional code). It will excatly tell you what's wrong. Print it out (Console.WriteLine) on the output window and you'll know.&lt;/P&gt;
&lt;P&gt;LOTD: Lesson Of The Day is a series starting on my blog.&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/68410.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/68410.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/68410.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/68410.aspx</trackback:ping>
    </entry>
    <entry>
        <title>File path in C#</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/02/01/67868.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/02/01/67868.aspx</id>
        <published>2006-02-01T13:39:00-06:00:00</published>
        <updated>2006-02-01T13:40:00Z</updated>
        <content type="html">&lt;P&gt;When you have to pass in a file path to do some processing with the file, try using the following C# code.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#a52a2a size=2&gt;string path = Path.Combine(Environment.CurrentDirectory, @"..\..\TestDeserialization.xml");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Where,&lt;/P&gt;
&lt;P&gt;The TestDeserialization.xml file is in the Project root directory.&lt;/P&gt;
&lt;P&gt;It helps to avoid confusion in file paths.&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/67868.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/67868.aspx</wfw:comment>
        <slash:comments>41</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/67868.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/67868.aspx</trackback:ping>
    </entry>
    <entry>
        <title>The "true" Checklist for XML Performance</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/01/26/67197.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/01/26/67197.aspx</id>
        <published>2006-01-26T12:14:00-06:00:00</published>
        <updated>2006-01-26T12:14:00Z</updated>
        <content type="html">&lt;P&gt;&lt;A href="http://monkey.workarea.jp/lb/archive/2005/8-08.html"&gt;http://monkey.workarea.jp/lb/archive/2005/8-08.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/67197.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/67197.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/67197.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/67197.aspx</trackback:ping>
    </entry>
    <entry>
        <title>The Hanselman List of .NET Debugging Dos and Don'ts</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/01/26/67186.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/01/26/67186.aspx</id>
        <published>2006-01-26T09:09:00-06:00:00</published>
        <updated>2006-01-26T09:14:00Z</updated>
        <content type="html">&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't - &lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Say "Hey, I got a NullReferenceException," what's the problem?&lt;/FONT&gt;&lt;BR&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Provide a Stack Trace/Dump with the line number it likely happened on.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't - &lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Get deep into your complicated program, find a bug and insist it's BillGs fault.&lt;/FONT&gt;&lt;BR&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Reproduce the bug in some simple test program and tell the world. Remember, 9/10 times it's you.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't - &lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Decide there's a problem if you don't know the preferred behavior.&lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Always Assert your assumptions. If null can happen, check for it. BUT, if null must never happen&amp;nbsp;it's time for a Debug.Assert&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't - &lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Move code around blindly, somehow fix your bug, ignore it and keep coding. Programming by Coincidence! &lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Understand your program fully. Remember what &lt;A href="http://pragmaticprogrammer.com/ppbook/extracts/coincidence.html"&gt;Andy and Dave say about lucky folks who step into minefields&lt;/A&gt; and don't die. Just because you didn't die, doesn't mean there aren't mines!&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't -&lt;FONT color=#a52a2a&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Reformat or "pave" something because you don't know what's wrong. If you get a spot on your carpet, fix the spot. Don't lay new carpet.&lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Know enough about your environment to know what your program's dependencies are. If your registry settings can get boogered, Debug.Assert that you are getting good values from the registry.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't &lt;/STRONG&gt;- &lt;FONT color=#a52a2a&gt;Get overly frustrated with Assembly loading/versioning/policy. At least the Assembly Loader follows clear, set, rules.&lt;/FONT&gt; &lt;BR&gt;&lt;STRONG&gt;Do &lt;/STRONG&gt;- Make a folder called C:\FusionLogs, then go to the registry in HKLM:\Software\Microsoft\Fusion and make a DWORD value LogFailures=1 and string value LogPath=C:\FusionLogs. Every AppDomain that has a binding failure or weird redirect will get logged. Know: What assembly you want, what they looked for, what you got. Know where Assemblies are searched for.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't - &lt;/STRONG&gt;&lt;FONT color=#a52a2a&gt;Avoid debugging. Debugging in .NET is easier than ever before. Remote debugging and AttachToProcess are gifts. Don't stop at a point in the call stack if you can keep going by finding PDBs.&lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Keep your Source and PDBs in the same location. We keep ZIPs of every build's PDBs. Just today we dug up 9-month old PDBs and source (from CVS) to debug into some confusion. Not saving those PDBs would have screwed us. Create a Symbol Server.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't &lt;/STRONG&gt;- &lt;FONT color=#a52a2a&gt;Limit yourself to the QuickWatch. Learn what VS.NET has to offer.&lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Use the Immediate Window to test theories. Remember that you can perform Casts in the Watch Window. Remember that you can drag and drop variables into the Watch Window. Remember you have 4 Watch Windows, Autos, Locals, not to mention. Learn how to use Conditional Breakpoints!&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;Don't&lt;/STRONG&gt; - &lt;FONT color=#a52a2a&gt;not debug something just because you can't figure out how to launch the process from the VS.NET Project Properties.&lt;/FONT&gt;&lt;BR&gt;&lt;STRONG&gt;Do - &lt;/STRONG&gt;Debug|Processes|Attach to attach to processes that have your DLL loaded. Use ProcExp from &lt;A href="http://www.sysinternals.com/"&gt;SysInternals&lt;/A&gt;&amp;nbsp;as a better Task Manager to see .NET processes, as well as a system-wide DLL search. Who's got you loaded?&lt;/P&gt;
&lt;P&gt;(via &lt;A href="http://www.hanselman.com/blog/"&gt;Scott Hanselman&lt;/A&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/67186.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/67186.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/67186.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/67186.aspx</trackback:ping>
    </entry>
    <entry>
        <title>XML datatype in SQL server 2005 - just be sure</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/01/20/66561.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/01/20/66561.aspx</id>
        <published>2006-01-20T15:26:00-06:00:00</published>
        <updated>2006-01-25T09:18:00Z</updated>
        <content type="html">&lt;P&gt;In my last post I mentioned that SQL Server 2005 provides with you with the flexibility of having an XML document stored into one single column of &amp;#8220;Xml&amp;#8221; datatype. Just like a int, datetime or a nvarchar() datatype, you can define &amp;#8220;Xml&amp;#8221; datatype to store the whole Xml document or a fragment as long as your&amp;nbsp;XML is valid. &lt;/P&gt;
&lt;P&gt;But the catch here is if your XML file has a header something like &amp;#8220;&lt;?xml version="1.0" encoding="utf-8" ?&gt; &amp;#8220;, and you are sending this document as a string to the database, you are in trouble. You are presented with an exception something like &amp;#8220;&lt;FONT color=#ff0000&gt;XML parsing: line 1, character 38, unable to switch the encoding&lt;/FONT&gt;&amp;#8221;.&lt;/P&gt;
&lt;P&gt;So the solution is, while you are opening the FileStream, open with a second parameter &amp;#8220;Encoding.Unicode&amp;#8221;. That's it. So now your XML document is going to be stored in Unicode (UTF-16) format. However when you retrieve it back from database, remember to convert it to UTF-8, if you are expecting it.&lt;/P&gt;
&lt;P&gt;It pays to use &lt;A href="http://groups.google.com"&gt;http://groups.google.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Check out &lt;A href="http://msdn2.microsoft.com/ms187107.aspx"&gt;limitations with &amp;#8220;XML datatype&amp;#8220; in SQL server 2005&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;: Or better still, you are better off using the following.&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;m_sqlCommand.Parameters[&lt;/FONT&gt;&lt;FONT color=#800000 size=1&gt;"@XmlDocument"&lt;/FONT&gt;&lt;FONT size=1&gt;].Value = &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;new&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=1&gt;SqlXml&lt;/FONT&gt;&lt;FONT size=1&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;new&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=1&gt;XmlTextReader&lt;/FONT&gt;&lt;FONT size=1&gt;(xmlDocumentToPush, &lt;/FONT&gt;&lt;FONT color=#008080 size=1&gt;XmlNodeType&lt;/FONT&gt;&lt;FONT size=1&gt;.Document, &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;null&lt;/FONT&gt;&lt;FONT size=1&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/66561.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/66561.aspx</wfw:comment>
        <slash:comments>11</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/66561.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/66561.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Learning COM+ components</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2005/10/07/56306.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2005/10/07/56306.aspx</id>
        <published>2005-10-07T14:18:00-05:00:00</published>
        <updated>2006-01-20T16:26:00Z</updated>
        <content type="html">&lt;OL&gt;
&lt;LI&gt;Create a class inherited from ServicedComponent class by referencing System.EnterpriseServices.&lt;/LI&gt;
&lt;LI&gt;Write the logic in it and declare methods.&lt;/LI&gt;
&lt;LI&gt;Add class hierarchy as necessary.&lt;/LI&gt;
&lt;LI&gt;Compile the project.&lt;/LI&gt;
&lt;LI&gt;Go to command prompt and on to the bin\debug folder, and type in &lt;BR&gt;&amp;nbsp;&lt;FONT face="Courier New" color=#0000ff size=2&gt;sn -k CalculatorServiceComponent.snk&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;This is to strong-name and write the key pair to the .snk file.&lt;/LI&gt;
&lt;LI&gt;Move the .snk file to the root of the project folder.&lt;/LI&gt;
&lt;LI&gt;Have the following line in the AssemblyInfo.cs file of the project.&lt;BR&gt;&amp;nbsp;&lt;FONT face="Courier New" color=#0000ff size=2&gt;[assembly: AssemblyKeyFile("..\\..\\CalculatorServiceComponent.snk")]&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;Go to command prompt again and run,&lt;BR&gt;&amp;nbsp;&lt;FONT face="Courier New" color=#0000ff size=2&gt;regsvcs CalculatorServiceComponent.dll&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;You might get couple of warnings, which can be ignored depending on the severity.&lt;/LI&gt;
&lt;LI&gt;Go to Component services from control panel and look up the created COM+ components and the methods that have been defined.&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/56306.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/56306.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/56306.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/56306.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Starting a business - a thought</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/01/20/66564.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/01/20/66564.aspx</id>
        <published>2006-01-20T16:23:00-06:00:00</published>
        <updated>2006-01-20T16:23:00Z</updated>
        <content type="html">&lt;P&gt;&amp;#8220;Don&amp;#8217;t start a business if you can&amp;#8217;t explain what pain it solves, for whom, and why your product will eliminate this pain, and how the customer will pay to solve this pain. The other day I went to a presentation of six high tech startups and not one of them had a clear idea for what pain they were proposing to solve.&amp;#8221;&lt;/P&gt;
&lt;P&gt;(via &lt;A href="http://www.joelonsoftware.com/"&gt;Joel on software&lt;/A&gt;)&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/66564.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/66564.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/66564.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/66564.aspx</trackback:ping>
    </entry>
    <entry>
        <title>SQL Server 2005 express - connection problem</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2006/01/18/66290.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2006/01/18/66290.aspx</id>
        <published>2006-01-18T11:34:00-06:00:00</published>
        <updated>2006-01-18T11:35:00Z</updated>
        <content type="html">&lt;P&gt;At work I got installed the new SQL server 2005 express edition, with VS.Net 2005. Through the Visual Studio's server explorer I was unable to connect to my SQL express. After trying different things, I downloaded the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=82AFBD59-57A4-455E-A2D6-1D4C98D40F6E&amp;displaylang=en"&gt;SQL Server Management Studio Express CTP&lt;/A&gt;. But it had so many runtime bugs, that I couldn't help stop using it.&lt;/P&gt;
&lt;P&gt;I even tried setting up the TCP/IP and NamedPipes protocol to 'enabled' in the Configuration management tool of SQL server 2005. This is done to enable remote connections.&lt;/P&gt;
&lt;P&gt;After doing a lot of search on the internet, finally found the solution to this problem.&lt;/P&gt;
&lt;P&gt;When you connect through the Visual Studio 2005 server explorer, you need to specify &amp;#8220;.\SQLExpress&amp;#8221; as the server name as opposed to &amp;#8220;yourservername&amp;#8221; or &amp;#8220;(local)&amp;#8221; or &amp;#8220;SQLExpress&amp;#8221;. Simple solution but bad problem.&lt;/P&gt;
&lt;P&gt;I am on SQL server 2005 express now, right within the VStudio and the tool is damn good and fast.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: On a different note, SQL server 2005 has special &amp;#8220;Xml&amp;#8221; datatype which you can use to store XML documents, and dynamically &amp;#8220;XQuery&amp;#8221; them and setup relational database type of functionality. I am going to explore it now.&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/66290.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/66290.aspx</wfw:comment>
        <slash:comments>16</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/66290.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/66290.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Design Patterns reference</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2005/11/14/60025.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2005/11/14/60025.aspx</id>
        <published>2005-11-14T09:44:00-06:00:00</published>
        <updated>2005-11-14T09:44:00Z</updated>
        <content type="html">&lt;P&gt;Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. Here you will find information on these important patterns. &lt;/P&gt;
&lt;P&gt;To give you a head start, the C# source code is provided in 2 forms: 'structural' and 'real-world'. Structural code uses type names as defined in the pattern definition and UML diagrams. Real-world code provides real-world programming situations where you may use these patterns. &lt;/P&gt;
&lt;P&gt;A third form, '.NET optimized' demonstrates design patterns that exploit built-in .NET features, such as, attributes, events, delegation, and reflection. These and much more are available in our unique Design Pattern FrameworkTM. For an example of a .NET optimized pattern see our Singleton page. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;STRONG&gt; Creational Patterns &lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp; Abstract Factory&amp;nbsp;&amp;nbsp; Creates an instance of several families of classes &lt;BR&gt;&amp;nbsp; Builder&amp;nbsp;&amp;nbsp; Separates object construction from its representation &lt;BR&gt;&amp;nbsp; Factory Method&amp;nbsp;&amp;nbsp; Creates an instance of several derived classes &lt;BR&gt;&amp;nbsp; Prototype&amp;nbsp;&amp;nbsp; A fully initialized instance to be copied or cloned &lt;BR&gt;&amp;nbsp; Singleton&amp;nbsp;&amp;nbsp; A class of which only a single instance can exist &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Structural Patterns &lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp; Adapter&amp;nbsp;&amp;nbsp; Match interfaces of different classes &lt;BR&gt;&amp;nbsp; Bridge&amp;nbsp;&amp;nbsp; Separates an object&amp;#8217;s interface from its implementation &lt;BR&gt;&amp;nbsp; Composite&amp;nbsp;&amp;nbsp; A tree structure of simple and composite objects &lt;BR&gt;&amp;nbsp; Decorator&amp;nbsp;&amp;nbsp; Add responsibilities to objects dynamically &lt;BR&gt;&amp;nbsp; Facade&amp;nbsp;&amp;nbsp; A single class that represents an entire subsystem &lt;BR&gt;&amp;nbsp; Flyweight&amp;nbsp;&amp;nbsp; A fine-grained instance used for efficient sharing &lt;BR&gt;&amp;nbsp; Proxy&amp;nbsp;&amp;nbsp; An object representing another object &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Behavioral Patterns &lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp; Chain of Resp.&amp;nbsp;&amp;nbsp; A way of passing a request between a chain of objects &lt;BR&gt;&amp;nbsp; Command&amp;nbsp;&amp;nbsp; Encapsulate a command request as an object &lt;BR&gt;&amp;nbsp; Interpreter&amp;nbsp;&amp;nbsp; A way to include language elements in a program &lt;BR&gt;&amp;nbsp; Iterator&amp;nbsp;&amp;nbsp; Sequentially access the elements of a collection &lt;BR&gt;&amp;nbsp; Mediator&amp;nbsp;&amp;nbsp; Defines simplified communication between classes &lt;BR&gt;&amp;nbsp; Memento&amp;nbsp;&amp;nbsp; Capture and restore an object's internal state &lt;BR&gt;&amp;nbsp; Observer&amp;nbsp;&amp;nbsp; A way of notifying change to a number of classes &lt;BR&gt;&amp;nbsp; State&amp;nbsp;&amp;nbsp; Alter an object's behavior when its state changes &lt;BR&gt;&amp;nbsp; Strategy&amp;nbsp;&amp;nbsp; Encapsulates an algorithm inside a class &lt;BR&gt;&amp;nbsp; Template Method&amp;nbsp;&amp;nbsp; Defer the exact steps of an algorithm to a subclass &lt;BR&gt;&amp;nbsp; Visitor&amp;nbsp;&amp;nbsp; Defines a new operation to a class without change &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Source: &lt;A href="http://www.dofactory.com/"&gt;http://www.dofactory.com/&lt;/A&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/60025.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/60025.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/60025.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/60025.aspx</trackback:ping>
    </entry>
    <entry>
        <title>AJAX presentation</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2005/10/18/57264.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2005/10/18/57264.aspx</id>
        <published>2005-10-18T14:22:00-05:00:00</published>
        <updated>2005-10-19T16:11:00Z</updated>
        <content type="html">&lt;P&gt;I gave a presentation on AJAX today. It&amp;nbsp;was a knowledge sharing session at my company. Around 35 people attended the session. Though quite a few appeared silent and uninterested, there were some who were interested.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I got some valuable feedback on my presentation, which is as follows.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; You have good knowledge on the topic, you could have connected with the audience much more.. get them more involved.. by asking simple questions and asking for opinions..&amp;nbsp; You need to remember that, by being on the stage, you are looking to influence people to buy what you are saying.&lt;BR&gt;2.&amp;nbsp; The transition effects in the slides is not really a part of the template, so, you must have added it.. sometimes, these could be disturbing, as they have the potential to take away audience's attention from what you are saying to what they are seeing on the screen.&amp;nbsp; So, if at all, use of these effects should be minimal, to help spice up the presentation at key points only.&lt;BR&gt;3.&amp;nbsp; Some of the slides had long sentences in them.. I think it is not such a good idea.. we should look to have very short and crisp phrases, to be used by you as a hint to talk on the topic.&amp;nbsp; If and when audience sees a sentence like this, again, you are losing their attention, as they start reading it.. and also, you are losing eye contact with them since, you also tend to read it from the screen.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;I am going to make sure I follow the suggestions in the feedback.&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/57264.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/57264.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/57264.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/57264.aspx</trackback:ping>
    </entry>
    <entry>
        <title>AJAX Dictionary</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/vkamat/archive/2005/09/23/54726.aspx" />
        <id>http://geekswithblogs.net/vkamat/archive/2005/09/23/54726.aspx</id>
        <published>2005-09-23T08:44:00-05:00:00</published>
        <updated>2005-09-23T08:45:00Z</updated>
        <content type="html">&lt;P&gt;This is one more super duper example for the power of AJAX (Asynchronus Javascript And Xml). We had GMail, Google Suggest, Google Groups, GMaps etc already showing the power of it. I had already tried it out for a Pubs database using C#, just like Google suggest. But the dictionary idea is real good.&lt;/P&gt;
&lt;P&gt;Check it out: &lt;A href="http://www.objectgraph.com/dictionary/"&gt;http://www.objectgraph.com/dictionary/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;How does it work: &lt;A href="http://www.objectgraph.com/dictionary/how.html"&gt;http://www.objectgraph.com/dictionary/how.html&lt;/A&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/vkamat/aggbug/54726.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/vkamat/comments/54726.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/vkamat/comments/commentRss/54726.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/vkamat/services/trackbacks/54726.aspx</trackback:ping>
    </entry>
</feed>
