Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
The ToString method of the Convert class lets you easily and quickly convert a decimal value into a string representation of that number to binary, octal, or hexadecimal base: ‘
‘ These two VBScript routines can be use to encrypt data passed on the ‘ querystring, ‘ so that users can’t decode what is being passed between ASP pages.’ USE:
This is an ASP based Message Board. It is driven by a SQL Database and it supports attachments (uploads are handled by SoftArtisan FileUP component, but it can be easily
‘ a class to display the BrowseForFolders dialog’ usage:’ Dim diag As New BrowseForFoldersDialog()’ diag.Description = “Select a directory”‘ If diag.ShowDialog() = DialogResult.OK Then’ ‘ the user selected this directory’
You can host the WebBroweser in a Windows Forms application, similarly to what you can do with any other ActiveX control. You just need to right-click on the control toolbox,
The System.Net.Dns class exposes a few static methods that let you resolve an internet domain name – such as www.vb2themax.com – into a 4-part numeric IP address, also known as
The .NET framework includes a ByteViewer control, that you can use on your own forms to display data stored in a Byte array or in a file. The ByteViewer control
The String.Format function supports many formatting options, but none allows you to display right-aligned columns of numbers, as in: 1.00 12.00 123.00 1,234.00 However, you can easily create a helper
Private Type DEVICE_MEDIA_INFO Cylinders As Double MediaType As STORAGE_MEDIA_TYPE TracksPerCylinder As Long SectorsPerTrack As Long BytesPerSector As Long NumberMediaSides As Long MediaCharacteristics As LongEnd TypePrivate Type GET_MEDIA_TYPES DeviceType As Long
Although ASP.NET lets you distribute web.config files over all the application’s subdirectories, it surely doesn’t force you to do so. You can keep all the application settings in its main
At times you want to keep a log of all the exception occurred in your application, including those that are correctly caught by a Catch block. At first you might
Some ASP.NET settings are so critical that the system administrator should prevent them from being changed by individual applications. This ability is especially crucial for servers that host multiple applications
The httpRuntime tag in ASP.NET configuration files lets you determine several behaviors of ASP.NET at the machine or site, including the global value for script timeout. Here’s the complete syntax
The tag in ASP.NET configuration files affects how error pages are managed in an ASP.NET application and whether developers can redirect users to their custom error pages when an exception
The httpRuntime tag in ASP.NET configuration files lets you determine several features of ASP.NET at the machine or site level, including the how ASP.NET uses multi-threading. Here’s the complete syntax
This is a very handy and easily understandable code. There are two different methods, depending upon the type of data that is required as input to the functions: function CompareDatesOne(firstdate,seconddate){
We all know that the For-Next and While-Wend loops execute statement(s) as long as the loop condition is true. However, there is a difference between the two. A loop condition
If you run this statement In SQL Server Query Analyzer: EXEC master..xp_cmdshell ‘dir *.exe’ You will get the result as DOS DIR Command. Using this, you can run all DOS
The following functions are used to extract the character in the string to the left or to the right. Left(), Right() functions are not available in Javascript. function Left(str, n){
You may encounter a situation where you need to open a “Save As” dialogue box for downloading files of different types on to the client machine. You might have found
Below is a VB Script example of how to validate an email address using Regular Expressions:
Import the complete path of the following files in your application using the #import statement: MSO9.DLL msoutl9.olb HRESULT hr;CComBSTR inputStr;inputStr = CString(“MAPI”).GetBuffer(0);CoInitialize(NULL);Outlook::_ApplicationPtr xyz(“Outlook.Application”);_bstr_t name(inputStr, true);Outlook::_NameSpacePtr nsp = xyz->GetNamespace(name);CComBSTR cTo =
There will always be situations when you need to insert a record in a table, but the data needs to be collected from other tables present in the database itself.
The Indexing Service should be started before using the following code.The File content search relies on the Microsoft OLE DB Provider for the IndexingService. The following query lists all the
Use this snippet to remove duplicates from a delimited string: DECLARE @mystring varchar(1000), @myword varchar(50),@CachedStringvarchar(2000)set @CachedString=”DECLARE @i int,@j intSELECT @mystring = ‘cat dog fox cat chicken hen goose cat bird
This generic class will help to obtain a deep copy of any object and cast it to the Object Type: public class ObjectCloner{ private ObjectCloner(){} // returns a deep copy
Scheduling recurrent or future events can be a hassle, but the Timer class can make it a lot easier. With a couple of simple calls, you can create any number
If you want all exceptions to go to the same file, use this code: import java.io.*;import java.util.Date;public class Logger{public static synchronized logException(Exception ex){try {RandomAccessFile ff = new RandomAccessFile(“c:\name.log”,”rw”);// to append
In the code below, inter is an interface which has a method add(int i1,int i2). The implementation is done in Impl class. Interface code(inter.java)public interface inter{ public int add(int i1,int
// conn – having a database connection alreadyPreparedStatement stmnt = null;ResultSet rs = null;try{ // ‘?’ indicates placement of a parameter. stmnt = conn.prepareStatement(“SELECT firstName FROMemployees WHERE salary > ?”);











