Tip Bank

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

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