Monday, November 13, 2006

.Net 2.0 - XslCompiledTransform ToString

System.Xml.XSL.XslTransform is deprecated(obsolete) in .Net 2.0  framework. What this means is the old method of applying  the transform method(XSL.Transform) is not going to work in the future versions of the framework. Instead, you need to apply the transform method of System.Xml.Xsl.XslCompiledTransform class.

I  literally spent hours trying to figure out how to do this. all the online samples were pretty "useless", until i found this. Thanks to everyone. It made me feel better, that i was not alone with this problem.

This is the helper class, Many thanks to Willis

public static class XslHelper
{
   public static String TransformInMemory(XslCompiledTransform transform, String input)
   {
      StringBuilder sb = new StringBuilder();
      XmlReader xReader = XmlReader.Create(new StringReader(input));
      XmlWriter xWriter = XmlWriter.Create(sb);
      transform.Transform(xReader, xWriter);
      return sb.ToString();
   }

   public static String TransformInMemory(String transform, String input)
   {
      XslCompiledTransform xsl = new XslCompiledTransform();
      xsl.Load(XmlReader.Create(new StringReader(transform)));
      return TransformInMemory(xsl, input);
   }
}

Happy Programming!!

 

 


ASP.NET | XML
11/13/2006 1:36:33 AM (GMT Standard Time, UTC+00:00)  #  Comments [0] 
 Sunday, November 12, 2006

Ajaxification and the server response times

There is so much buzz about Ajax that literally it is used everywhere over the web. But people often forget the price we pay for using Ajax literally everywhere. It makes the sites to load slow, respond slow but the features are too coool. Classic example being the new yahoo mail.

Take a look at this article from Jeff. It is amazing to see what a 0.5 delay in a site response time could do to customer satisfaction


General
11/12/2006 5:36:59 PM (GMT Standard Time, UTC+00:00)  #  Comments [0] 
 Friday, October 27, 2006

ASP.Net Site Configuration, SQL 2005

one would assume that it is easy to use ASP.Net Site Configuration tool. i had to spend around 2 hrs to get this straight. I apparently had every problem you could encounter..

ASP.Net Site Configuration on a server

Steps to follow

Extablish mixed authentication mode


ASP.NET | General | SQL
10/27/2006 5:17:30 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 
 Thursday, October 26, 2006

Sabbatical from blogging?

was in seattle, vancouver for my visa. hence the break.

 


General
10/26/2006 4:23:40 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 

Mapping drives via Remote Desktop, etc

all links from Jason Haley

Cool article

Effective presentation

 



10/26/2006 4:04:36 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 
 Tuesday, October 10, 2006

Cool Page Transition Effects

I have implemented some cool page transition effects. These tags eliminate the flashing when the page loads (when you click on a link etc). Thanks to Nikhil for giving this excellent piece of code.

<meta http-equiv="Page-Exit"
    content="progid:DXImageTransform.Microsoft.Fade(duration=.5)" />


ASP.NET
10/10/2006 2:06:40 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 
 Monday, October 09, 2006

Yahoo Developer Network Opens Up for .Net Programmers

Yahoo is warming up to .Net programmers. Now any one can access yahoo resources through their API's upon authetication through a browser. This is an awesome move in so many ways. this would help the users in accessing all their resources at yahoo,etc(standalone or through API's)  through a common single application. Talking about single point access, Netvibes and pageflakes are creating a lot of buzz these days.


ASP.NET | General
10/9/2006 5:10:12 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 
 Thursday, October 05, 2006

SQL: Return "identity" rowID after inserting data and naming stored procedures

Often times as a developer we all need to insert new records into a table in a database and also retrieve the identity id of the most recently added row. The most common solution to this situation is use @@Identity. Simple eh? No, because @@Identity returns the most recently created identity for your connection.  So if there is any other operation going on like a trigger, the identity created by the trigger would be returned instead of yours.

So it is better to use scope_identity() always.

Naming stored procedure with a prefix of sp_ is pretty common, i should say that is the current norm. But Apparently this is a bad habbit because the system databases are the only ones that should be named with prefix sp_.
Long story short, SQL server starts looking for any stored procedure with a prefix sp_ in the Master database.

For more on the above feature,  go here . Pretty cool dont's info on SQL practices


SQL
10/5/2006 5:01:33 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 

Free Microsoft E-learning Courses

Microsoft is offering free E-learning courses This should be a pretty cool deal for all the newbies.


ASP.NET | General
10/5/2006 2:29:42 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0] 
 Wednesday, October 04, 2006

You do not need an IPOD to listen to Podcasts

there is so much ignorance among the so called "tech savvy" guys. I was at an electronic retail shop recently and came across this interesting conversation between the sales guy and a middle aged customer. The sales guys basically told his customer that he needs the best(expensive) IPOD to be able to listen to Podcasts. Normally, I would not venture into some private conversation but this time I had to barge in..

Is there a moral in this story?

 


General
10/4/2006 5:29:15 AM (GMT Daylight Time, UTC+01:00)  #  Comments [0]