<rss version="2.0" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.net 2.0</title>
        <link>http://geekswithblogs.net/madhawa/category/4822.aspx</link>
        <description>.net 2.0</description>
        <language>en-US</language>
        <copyright>Madhawa Karunaratne</copyright>
        <managingEditor>madhawa@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>STSDEV: Simple Tools for SharePoint 2007 Development, With different project name support</title>
            <link>http://geekswithblogs.net/madhawa/archive/2008/08/26/124686.aspx</link>
            <description>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;font face="Verdana" size="2"&gt;STSDEV is a simple tool for SharePoint developers. It helps you to create SharePoint projects (with solutions precisely) and deploy templates and components into the SharePoint 2007 platform.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;a href="http://www.codeplex.com/stsdev"&gt;&lt;font face="Verdana" size="2"&gt;http://www.codeplex.com/stsdev&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;font face="Verdana" size="2"&gt;This tool creates project and solution in same name and in the same folder. We all know we never put the solution and project files in the same folder and never use same name for the solution and the project. Unfortunately we didn’t find a way of changing those and use the tool after since it gives errors. I found a very easy way of tweaking that from changing small line in the source code or changing a line in the generated .target file. &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;font face="Verdana" size="2"&gt;And furthermore I have changed the tool to support for supplying a different project name when creating a solution and now we are using it in our SharePoint project. &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;font face="Verdana" size="2"&gt;BTW I'll explain how to tweak the tool to use separate source folder for project by a small change in the source code in next post. Until then play with the tool and have some fun.&lt;img alt="" src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;font face="Verdana" size="2"&gt;If you want that version of the tool with source code please &lt;/font&gt;&lt;a href="mailto:madhawa@gmail.com?subject=STSDEV%20with%20project%20name%20support"&gt;&lt;font face="Verdana" size="2"&gt;email me&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt" align="justify"&gt;&lt;span style="TEXT-TRANSFORM: uppercase"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124686"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124686" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/madhawa/aggbug/124686.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Madhawa Karunaratne</dc:creator>
            <guid>http://geekswithblogs.net/madhawa/archive/2008/08/26/124686.aspx</guid>
            <pubDate>Tue, 26 Aug 2008 05:09:17 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/madhawa/comments/124686.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/madhawa/archive/2008/08/26/124686.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/madhawa/comments/commentRss/124686.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/madhawa/services/trackbacks/124686.aspx</trackback:ping>
        </item>
        <item>
            <title>Effective Error handling in SQL Server 2005</title>
            <link>http://geekswithblogs.net/madhawa/archive/2008/08/25/124661.aspx</link>
            <description>&lt;p align="justify"&gt;&lt;font face="Verdana" size="2"&gt;One of the main things you should consider if you believe in good coding is error or exception handling. When it come to programming languages, now all popular object oriented languages have try, catch method to handle an exception.&lt;br /&gt;
&lt;br /&gt;
We can put our code (which might gives errors or exceptions) inside the try block and error handling code in the catch block. This has become the de-facto of error or exception handling now.&lt;br /&gt;
But when it comes to T-SQL we hadn’t got that luxury. Error handling in T-SQL was always tedious and tricky job. Most of the time we used not to handle the error at the T-SQL level but handling it in the upper most level. (data access layer or business layer, handling database errors in business layer is a totally wrong practice)&lt;br /&gt;
&lt;br /&gt;
But now in SQL 2005, 2008 you have proper error handling mechanism just like in modern OO languages. You can use try catch in the stored procedures and functions. Actually I knew that I can use try catch in stored procedures but only today I got to know about a more interesting method we can use.&lt;br /&gt;
&lt;br /&gt;
After catching an error what we can to do was a question for me. If it’s in C# or Java we can log the error and may be throw a customized exception to the next layer. (There are so many options in handling errors)&lt;br /&gt;
Can you remember throw exception in C#? Of cause you know it. :) Well… we can do the same in T-SQL using RAISERROR function. &lt;br /&gt;
&lt;br /&gt;
Using the RAISERROR is as follows,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;BEGIN TRY&lt;br /&gt;
    -- RAISERROR with severity 11-19 will cause execution to &lt;br /&gt;
    -- jump to the CATCH block.&lt;br /&gt;
    RAISERROR ('Error raised in TRY block.', -- Message text.&lt;br /&gt;
               16, -- Severity.&lt;br /&gt;
               1 -- State.&lt;br /&gt;
               );&lt;br /&gt;
END TRY&lt;br /&gt;
BEGIN CATCH&lt;br /&gt;
    DECLARE @ErrorMessage NVARCHAR(4000);&lt;br /&gt;
    DECLARE @ErrorSeverity INT;&lt;br /&gt;
    DECLARE @ErrorState INT;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;    SELECT &lt;br /&gt;
        @ErrorMessage = ERROR_MESSAGE(),&lt;br /&gt;
        @ErrorSeverity = ERROR_SEVERITY(),&lt;br /&gt;
        @ErrorState = ERROR_STATE();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;    -- Use RAISERROR inside the CATCH block to return error&lt;br /&gt;
    -- information about the original error that caused&lt;br /&gt;
    -- execution to jump to the CATCH block.&lt;br /&gt;
    RAISERROR (@ErrorMessage, -- Message text.&lt;br /&gt;
               @ErrorSeverity, -- Severity.&lt;br /&gt;
               @ErrorState -- State.&lt;br /&gt;
               );&lt;br /&gt;
END CATCH;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Pretty good ha…&lt;br /&gt;
You can follow up this more in &lt;/font&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms178592(SQL.90).aspx"&gt;&lt;font face="Verdana" size="2"&gt;MSDN&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt; &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124661"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124661" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/madhawa/aggbug/124661.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Madhawa Karunaratne</dc:creator>
            <guid>http://geekswithblogs.net/madhawa/archive/2008/08/25/124661.aspx</guid>
            <pubDate>Mon, 25 Aug 2008 07:05:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/madhawa/comments/124661.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/madhawa/archive/2008/08/25/124661.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/madhawa/comments/commentRss/124661.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/madhawa/services/trackbacks/124661.aspx</trackback:ping>
        </item>
        <item>
            <title>How to get XML view of a typed DataSet in Visual Studio 2005?</title>
            <link>http://geekswithblogs.net/madhawa/archive/2006/11/03/95991.aspx</link>
            <description>&lt;p&gt;&lt;font size="2" face="Verdana"&gt;If you are coming from vs2k3 background you might know how easy to get the XML view of a Typed DataSet. But unfortunately in vs2k5 they have removed that convenient XML view tab.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Verdana"&gt;So how we gonna see the xml of the typed dataset. One of my friends asked me today and my instance answer was use other editor to get that facility. But after doing some research I found that we can get into xml view by right clicking the XSD file in the solution explorer and picking “open with”. Not only the xml view but you can choose some other views from couple other options.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=95991"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=95991" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/madhawa/aggbug/95991.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Madhawa Karunaratne</dc:creator>
            <guid>http://geekswithblogs.net/madhawa/archive/2006/11/03/95991.aspx</guid>
            <pubDate>Fri, 03 Nov 2006 06:27:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/madhawa/comments/95991.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/madhawa/archive/2006/11/03/95991.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/madhawa/comments/commentRss/95991.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/madhawa/services/trackbacks/95991.aspx</trackback:ping>
        </item>
    </channel>
</rss>