January 11, 2002

Implement a Generic Custom Validation Control

This Tip applies to Microsoft .NET Framework. using System; using System.Text.RegularExpressions; public class CustomValidations { public CustomValidations() { } /// /// This method is used for validating _the string and returns /// true , if _the string contains alphabets /// otherwise _false. /// /// /// string : Regular Expression to

A New Way to Deal with Popup Windows

When creating a popup window from a hyperlink or button, I often get an error because I try to do it myself and the author has hard coded the same behavior. A little consideration for advanced users will avoid irritating them.Instead of: Prompt Use this: Prompt This is another way:

Move Selected Items from One Multiple Select to Another

A common task on Web pages is to select a subset of a given set of items. Depending on the page design and concept, you can use checkboxes or multiple select menus.When using multiple select menus, people often make Javascript arrays to keep the item values and texts for both

Create Temporary Tables in MS SQL Server 7.0

Sometimes a user wants to create a temporary table in the database during the execution of a stored procedure or sequence of SQL queries. To create a temporary table that lasts for only the duration of the user session, Use # before the table name.You can use SELECT… INTO or

Get a Summary Report of all SQLServer Databases Using a Single Select

Using the sysdatabases and Case statements, you can obtain a detailed report of all the databases on your server. Sysdatabases contains one row for each database. It is Compatible with SQL Server version 7 and version 2000. SELECT LEFT(name,30) AS DatabaseName, SUBSTRING(CASE status & 1 WHEN 0 THEN ” ELSE

Check Which Files are Included in a Backup Device

In SQL Server, if you just want to check which data- and logfiles are included in a database backup device, you can use ‘RESTORE FILELISTONLY FROM xyz’ (with xyz representing the actual device) for this. For example, on my machine, the following command gives the result specified below: RESTORE FILELISTONLY

Control the Scope of a Singleton in an Application Server

Here is the code defining a singleton class: public class SingletonClass{ private static int id = 0; private static SingletonClass sclass = null; private SingletonClass(){} public SingletonClass getInstance(){ if(sclass ==null ) sclass = new SingletonClass (); return sclass; } public void setID(int _id){ id = _id } public void getID(){

No more posts to show