Friday, September 14, 2007

Portable Software on USB

PortableApps.com - Portable software for USB drives | Your D...

Convenient

Now you can carry your favorite computer programs along with all of your bookmarks, settings, email and more with you. Use them on any Windows computer. All without leaving any personal data behind.

A very nice way of being able to carry some convenient pieces of software around on a USB drive for troubleshooting others systems.

Thursday, September 13, 2007

T-SQL Sproc timeout in .NET but not Management Studio

I recently had a rather odd problem which I have been unable to solve to my satisfaction so far.

Problem:
The problem involves stored procedures which are compiled and cached. When calling the sproc from a c#.net 2.0 web application the call would timeout; however I could capture the call in SQL Profiler, run it in Management Studio and it would run great in sub second times.

Solution:
The only solution I have found so far is to re-compile the sproc manually.
You could also try adding WITH RECOMPILE to the sproc and deal with the performance loss. This was suggested in a sqlteam thread:
A similar suggestion is on SQLServerCentral.com

After reading Ken Henderson's WebLog I am guessing that the cached plan is somehow getting corrupted and that running the code manually in Management Studio somehow uses a different cached plan. Perhaps plans are different for each user? Hopefully I can find and post a better solution.

Publish WebSite - precompiled

ASP.NET Deployment Tool

An avanced and robust Deployment Tool for precompiling your ASP.NET Websites! Pre-Compilation gives your site a performance boost and secures it. Precompile and deploy your Website for speed improvements and security, specific Error Panel, FTP Support, Deploy to Network, Merge Assemblies, easy to use.
----------------------------
A free addon type utility that can be used to precompile a .net website. Basically it compiles all the aspx and dll code into what the webserver typically does on first site access. The two benefits of this are: 1. no code aspx or cs is visible 2. website first load doesn't have any extra overhead downsides are: 1. the site has to be recompiled for any change 2. there are no relative paths anymore so moving the site or changing its directory could have disasterous results.
-----------------------------
http://msdn2.microsoft.com/en-us/library/1y1404zt(VS.80).aspx
Microsoft has a built-in tool which has almost as many features as this tool, the big difference is that theirs doesn't come with the free edition of visual studio.

Wednesday, September 12, 2007

asp.net - Display inline PDF on webpage

Embed PDFs into a Web Page with a Custom Control - The Code ... This article describes an approach to embedding and displaying PDF documents in a web page through the use of a simple ASP.NET 2.0 custom server control. The approach indicated herein allows the developer the opportunity to control the web page content surrounding the embedded PDF; this is in contrast to linking directly to a PDF which uses the entire web page to display PDF but does not otherwise permit the developer to control the appearance of the page.

-----------------------
Honestly I think that this approach is an error prone and overbloan method of creating an IFrame. A much simpler method of accomplishing what I needed in this instance is:
System.IO.FileInfo file = new System.IO.FileInfo(Server.MapPath(cPage.RedirectURL));

Response.Clear();
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/pdf";
Response.WriteFile(file.FullName);
Response.End();

Tuesday, September 11, 2007

Friday, September 7, 2007

CSS2 Reference

CSS2 Reference This page has a complete listing of all CSS properties and the values they can be set to. Very useful. It also has the well known and legendary w3schools.com name to add value to the content.

Left Join vs Left outer Join - Join vs Inner Join

Join vs Inner Join - dBforums Hi all, Can someone please describe whats the difference between: 1) Join vs Inner Join 2) Left join vs Left Outer Join TIA Falik ------------ According to this thread, the words Inner and Outer are optional in the Join syntax. This is something that wasn't ever really clear to me before so it is good to have it cleared up. The shorter code the better so I will happily stop using the non required words.