The Latest

DevX - Software Development Resource

A dual use of a lookup query

Usually in your application you use two different types of lookup query; the first one is for retrieving a page of records (or all records) to populate a pick list,

DevX - Software Development Resource

Emerging from the Technological Winter

atching the effects of economic deterioration on IT departments over the last two years has been incredibly depressing. But such observance has provided moments of clarity, among them this sad

DevX - Software Development Resource

ChoiceList

ChoiceList is an ActiveX control that allows the programmer to present a user with a list of choices and encapsulates the code necessary to allow the user to select one,

DevX - Software Development Resource

MDAC 2.6 is required for .NET applications

All ADO.NET applications require MDAC 2.6 or later (MDAC 2.7 is recommended). MDAC 2.7 comes with Visual Studio .NET but no MDAC version is included in the Microsoft .NET Framework

DevX - Software Development Resource

Close the DataReader before changing database

The ChangeDatabase method of the ADO.NET Connection object requires an open connection to execute correctly. Even if the connection is open, you can still have an InvalidOperationException when invoking this

DevX - Software Development Resource

Backward Compatibility: How Long Is Long Enough?

he media, particularly over the past decade, has made a huge point of discussing how fast computer technology changes. Terms such as “Internet years” and “Moore’s law” have been used

DevX - Software Development Resource

Migrating from SQL Server to Oracle Series

In this series, SQL Server expert Joe Lax will be describing the steps he takes to learn Oracle database administration. Included are editorials, book reviews, and technical articles that chart

DevX - Software Development Resource

How to Create and Use CallableStatement Objects

A CallableStatement object provides a standard way for all RDBMS’ to call stored procedures. A stored procedure is stored in a database; the call to the stored procedure is what

DevX - Software Development Resource

Send NET SEND Messages

This code is how to send NET SEND messages to all the connected SQL Server users in an NT local area network: CREATE PROC notify_users(@notification VARCHAR(100) = ‘SQL Server shutting

DevX - Software Development Resource

Passing Arrays by Value

It has already been said many times that (a) std::vector is preferred to c-style arrays, and (b) Arrays, vectors, and other data structures should preferably be passed by reference.While this

DevX - Software Development Resource

Making a Class Final

The following code explains how to make a class that is final, meaning that it cannot be derived further. class FinalBase{ FinalBase() {} friend class Final;};class Final : private virtual

DevX - Software Development Resource

Save Expensive Heap Allocations

Fixed-size arrays in local variables use a stack-allocated descriptor as expected, but all the data for an array is allocated on the heap. However, fixed-size arrays embedded in structures are

DevX - Software Development Resource

Allow Context-Sensitive Help for Disabled Controls

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

DevX - Software Development Resource

Get Date Format String

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:

DevX - Software Development Resource

Set the Cursor for Your Components

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

DevX - Software Development Resource

Creating and Using Thread-Scoped Variables

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

DevX - Software Development Resource

An Easy Way to Check Boolean System Properties

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

DevX - Software Development Resource

Scope of Variables Declared in for()

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

DevX - Software Development Resource

Sorting Part of a Field

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 Related