Skip to main content

Posts

DOTNET - Tips and Tricks

Been a while since I blogged on dot net and cant wait any more- I would like to highlight a couple of things that can be very handy and you should be aware of if you are not- 1. Taking a site offline- When you make an ASP.NET website offline, many developers simply stop the website using IIS after informing the stake holders. A neater way of doing this is to place a file named "app_offline.htm" in the root directory of the website. This will force IIS to display contents of this page instead of any other page requested from your website. Note: The size of the file should exceed 532 KB. This is a know limitation 2. In Visual Studio while working on any file, if you need to indent the code, you can let Visual Studio do the job by using the shortcut Ctrl+K+D. Visual Studio automatically indents the code for you (assuming you have no syntax errors in your code) and it does a neat job. This tip can be very handy and save you lot of time. 3. Some important keyboar...

Annoying pop-ups

I was recently working on a tool which gave an annoying popup that some error has occurred and had to click "OK" to get rid of it and continue the process. This proved really cumbersome as I had to monitor the process too often to be able to get rid of the blocking popup. I looked up on the web and found an answer to this issue- http://stackoverflow.com/questions/5868801/tools-code-to-automatically-click-ok-on-dialogs I used BuzOf a very handy utility that can get rid of annoying popups - http://www.basta.com/Product.aspx?pid=13 Just teach BuzOf which window to handle and which button to click and it will make things easy for you. Until next post c ya Hitesh

SQL Server 2008 - Performance Counter Registry Hive Consistency Failed Error

If you ever get the following error during installation of SQLServer 2008 and wonder how to proceed. Let me help you out. You need to execute the following command in elevated command prompt to repair the registry from backup lodctr /R command from C:\windows\system32 directory and lodctr /R command from C:\windows\sysWOW64 directory (if running on a 64 bit OS) Hope this helps Regards Hitesh

Office 2007 Sequencing Recipe

Hello, I had a tough time sequencing office 2007 ( http://support.microsoft.com/kb/939796 ) as i am new to sequencing and faced one issue that seemed difficult to solve. After launching Microsoft Word i got the following error "2007 Microsoft Office System - Please wait while setup prepares the necessary files." "Windows Installer - Preparing to Install" I found a KB article which explained exactly what i need to do http://support.microsoft.com/kb/928091 Here is an extract which i followed to eliminate the error To bypass the auto-registration for Word 2007, follow these steps: Exit Word 2007. Start Registry Editor. In Windows Vista, click Start Collapse this image Expand this image , type regedit in the Start Search box, and then press ENTER. Collapse this image Expand this image If you are prompted for an administrator password or for a confirmation, type the password, or click Continue . In Windows XP, click Start , click Run , typ...

Calling a .NET DLL Function from VBA

Recently i had to call .NET code from my VBA Macro in order to do something not available out of the box using VBA. i searched a lot of content on the web and found this wonderful web page http://www.geeksengine.com/article/create-dll.html The article clearly explains how to create a dll and reference it in VBA. There were a some issues I hit upon while following the instructions mentioned in the link 1. In my code I had the following line of code     Set f1 = New myplugin.Class1 The VBA compiler complained invalid use of New Keyword. I then modified my code to the following based on a colleague's suggestion Set f1 = CreateObject("myplugin.Class1") and then it worked fine. 2. On trying to create an instance of the .NET class in my VBA code When distributing the dll by using following link, I hit upon an issue http://www.geeksengine.com/article/register-dll.html I was getting the following error on target machines RegAsm: error RA0000...

Introduction to AJAX

Asynchronous Javascript (AJAX) technology enables web applications to provide features like- Partial Page Updates - Allows you to define an area of a webpage to postback and update independently from the rest of the page. Only the updated content is refreshed when the request completes Indicate Progress of an operation - This allows you to track progress of server-side process and continuously update the user. Desktop-like UI - With AJAX, you can provide users with controls such as modal dialog boxes, progress indicators, masked edit bixes, tooltips and more. Cross Browser, cross platform support - Javascript, AJAX and JQuery are all supported on multiple browsers and multiple platforms. Every ASP.NET page that uses AJAX must have one and only one ScriptManager class which enables- Registration of custom scripts Registration of web service method calls from client Since you can use only one instance of ScriptManager class in an ASP.NET page there is a ne...

Visual Studio Tools for Office (VSTO)-Introduction

This blog post is an extract of VSTO for Dummies. VSTO isn' t a replacement technology for Visual Basic for Applications (VBA). VSTO is a set of tools that you can use with Visual Studio to supercharge Office. Put simply, VSTO offers tools to - 1. Build add-ins 2. Build customised documents for Office Applications like Word and Excel. Add your custom functionality to existing Office applications, via add-ins. Leverage all the existing Office functionality in your applications, like Word document layout and Excel formulas, through communicating with those add-ins Make documents that integrate fully with existing applications and databases Use Microsoft SharePoint to increase communications between knowledge workers with add-ins and documents that communicate. At their core, Customized Documents are document-level only, while add-ins are application-level and can apply to all documents used by that installation of Office. Four important features are availabl...