If these errors are occuring while running the .asp pages then below is the fix that will make things working for you.

1. Error as displayed in the browser: The server failed to load application. Check Eventlog for more details.

2. System log in the eventvwr - W3SVC: The server failed to load application '/LM/W3SVC/1/ROOT'. The error was 'Class not registered'.

3. Event Viewer Application Log for MSDTC CLIENT
Event Type: Error
Event Source: MSDTC Client
Event Category: (10)
Event ID: 4427
Failed to initialize the needed name objects. Error Specifics: d:\comxp_sp3\com\com1x\dtc\dtc\msdtcprx\src\dtcinit.cpp:215, Pid: 2536
No Callstack,
CmdLine: C:\WINDOWS\System32\dllhost.exe /Processid:{xxxx}

4. Component Services -> COM+ in MMC, it will throw error.

This means that COM+ on your system is corrupted and it is not able to communicate with msdtc. Also it is not able to get to the IIS Components/Packages in your COM+.

1. Fix MSDTC:

a. Go to the command prompt
b. Change directory to C:\%windir%\system32
c. Type: msdtc -uninstall
d. Restart PC
e. Go to the command prompt
f. Change directory to C:\%windir%\system32
g. Type: msdtc -install

2. After, msdtc is installed (Component Services -> COM+ in MMC will not throw any errors). Delete and re-register IIS Components/Packages in the COM+ by following the below steps:

IIS related package in Component Services MMC
1. IIS In-Process Applications
2. IIS Out-of-Process Pooled Applications
3. IIS Utilities

a. In the Command Prompt, go to %windir%\system32\inetsrv folder
and run >rundll32 wamreg.dll, CreateIISPackage command

b. run >regsvr32 asptxn.dll

c. Then reset IIS using iisreset command, then re-open Component Services MMC to verfiy the IIS Components/Packages are recreated.

The above steps should make your .asp pages render properly!!!!!

Detect Windows service status .Net

Posted by Techie Cocktail | 1:39 PM | , , | 0 comments »

Good article to detect the status of a windows service using a ServiceController class in .Net - Detect Windows Service Status

ASP.Net Configuration

Posted by Techie Cocktail | 10:14 AM | , | 0 comments »

Configuration settings has got its own importance in asp.net. It stores various settings for a lot of programming areas in asp.net. Some of them being, storing connection strings, page-level trace settings, httphandlers, httpmodules, authentication & authorization settings and a lot more.

Its hard to remember all of these settings and their attributes. The below link is a good for reference link that covers most of the configuration settings:


Databinding Expressions

Posted by Techie Cocktail | 12:15 AM | | 0 comments »

Databinding is one of the most important aspect in ASP.Net. Databinding, and one does not think about using Eval and Bind methods, not possible. Mostly you will find these methods used in .aspx page, and within <%# and %> delimiters.

Both retrieve values from the data-bound fields underneath the data-bound controls and renders them to the html page within your data-bound controls. In addition to just retrieving the value from database field, the Bind method can also submit your changes back into the database. This is the main difference between Eval & Bind methods.

Eval is also called as read-only (select - database operation) method, and Bind is called as Read/Write (select, update, insert, delete - database operations) databinder method.

Get more details at MSDN explained very nicely.

Recover deleted emails in Outlook

Posted by Techie Cocktail | 11:47 PM | | 0 comments »

Do not worry if you have deleted your emails using Del or Shift+Del (permanent delete) in outlook because it provides an option to recover deleted emails.

Go to Tools -> Recover Deleted Items which pops open a dialog where you can select the mails to recover.


Posted by Techie Cocktail | 2:19 PM | | 5 comments »

SET ROWCOUNT causes SQL Server to stop processing the query after the specified number of rows are returned.

Once the ROWCOUNT is set then the following queries would return those many number of rows in the resultset irrespective of any filtering or conditions applied.

To turn off this option, set the ROWCOUNT to 0. This command can be executed by any
users. The user need not have any special permissions to execute this command.

SET ROWCOUNT <number> | <@number_var>

It is the best way to optimize a query, if we are aware of how many records we would
need at a time. For example, if you are performing custom paging for GridView in
asp.net 2.0, then you can set the query to return only the required number of rows as set in the PageSize property of the GridView.

Visit MSDN for more details with examples: MSDN

Introduction to Microsoft Office 2010

Posted by Techie Cocktail | 12:36 PM | | 1 comments »

Chris Bryant introduces the new Microsoft Office 2010. Checkout the video for more details.