
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.
Sometimes the user forgets to enter a date with date separators. A good way to deal with this is to correct the users mistake instead of forcing the user to
If you want a form to support context-sensitive help, set the WhatsThisButton and WhatsThisHelp properties on the form to True, and set the WhatsThisHelpID property to a corresponding help-file topic
There are many ways to count the occurrences of a string within a text. Here’s a simple function that uses the InStr() function: Function CountWords(ByVal Text As String, _ ByVal
There is no native function for returning the current date format string. Here’s a simple function that calls the GetLocaleInfo API in order to retrieve the short date format string:
All AWT component classes have a setCursor() method that allows for dynamically setting the cursor for a particular component and any subcomponents.For example, if you set the cursor for a
Sometimes you need variables scoped by thread so that each thread has an independent copy. There’s an easy way to create and manage such variables.The java.lang.ThreadLocal class provides a wrapper
If class B uses only pointers or references of class A, you don’t have to include A.h. You can simply forward declare class A as shown below. //File B.hclass A;
Suppose you want to pass a Boolean system property, -DDEBUG=true or -DDEBUG=false, from the command line. Normally, you’d probably use the following in source code to retrieve it: boolean b
// Quickly zero out a struct. This can be applied// To an array of structs also, since// memset() initializes memory regions#include struct sample {int a;short int b;int c;};struct sample s;//
The new ANSI C++ standard specifies that variables declared as in for(int i=1; …) have a scope local to the for statement. Unfortunately, older compilers (like Visual C++ 5.0) use
Use the following code: select *,right(field1,4) as Col1 from [Tablename]order by col1 You can do it by using substring: SELECT *, substring(field1, 3, 5) as col1from [tablename]order by col1
‘*********************************************************************’Text files Reading’You can use Microsoft Text Driver’*********************************************************************Public Function Read_Text_File() As ADODB.Recordset Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim conn As ADODB.Connection Set conn = New ADODB.Connection
This code will do the trick: ABCDEFGHIJKLMNOPQRSTUVWXYZ
It is possible to use VB6 ActiveX controls – such as ADO Data Control, Chart Control, Comm Control, and the Windowless controls – with the designer of Visual Studio .NET,
If your solution contains a setup project and this setup project has been built at least once, you get an Assembly Load error when you run the Inheritance Picker in
When you need a timer for a larger interval than the Timer control allows, insert this code into a BAS module. The procedure starts when the timer interval has passed:
Dynamic Color Change of TextHello Good Morning
If you have dynamically generated form controls on a Web page, all with the same name, this is a good way to parse out each control’s value and load them
The Option button is a convenient way to display multiple options from which only one can be selected. One problem is that the Option button cannot be bound to a
Many professional applications are required to display a version number on all screens to indicate to users which version of the app is currently running. This also helps with configuration
‘ Saves a text file. If the destination file already exists,’ its content can be replaced, or the new content can be appended’ at the end of the file, according
‘ Returns the content of the specified text file’ Note: it can throw an exception’ Usage: Dim FileContent As String = LoadTextFile(“C:Autoexec.bat”)Function LoadTextFile(ByVal FilePath As String) As String Dim sr
‘ Copies a source directory to the destination directory.’ The last parameter specifies whether the files already present in the’ destination directory will be overwritten’ – Note: requires Imports System.IO’
‘ Returns the size of the specified directory’ – Note: requires Imports System.IO’ – Usage: Dim DirSize As Long = GetDirectorySize(“D:Projects”)Function GetDirectorySize(ByVal DirPath As String) As Long Dim DirSize As
‘ Open the standard dialog to download a file located on the server’ whose virtual path is passed as an argument. This routine is useful when’ you want to download
hose of you who program in Visual Basic, C, or other languages are probably used to writing your own functions. As a SQL programmer, you know how frustrating it’s been
s counterintuitive as it is, Oracle databases have no SQL command for assigning a new name to a table column yet they have such a command for renaming an entire
t the opening of this year, while the rest of the world was swearing off high-fat foods and cigarettes, I was making a far different kind of New Year’s resolution.











