devxlogo

Tip Bank

Embed Quotation Marks

You use quotation marks in VB to define strings, but how do you include them in your output? Use whichever of these methods works the best for you: Dim strUseChr

Moving Transaction Logs to a Different Drive

You can move a transaction log using SQL Server stored procedures. Simply detach the database, move the log file, then reattach the database. For example, to move the pubs database

Add Controls to a Project Quickly

VB’s Add File dialog supports only a single selection of code modules or OCXs, so you must painstakingly select each individual file and control one at a time. One of

String.valueOf or Integer.toString()?

Converting an integer to a string is a very common programming task. The most popular method for doing this are to use either String.valueOf(int) or Integer.toString(). Which one is better

Declaring Variables in C++

Say you want to store data for temporary use in a program. You will have to declare variables to input the data. Luckily, declaring variables in C++ is very easy.

Read a Complete Text File in One Pass

Typically, you read and process a text file by using a loop and VB’s Line Input statement: Do While Not Eof(1) Line Input #1, myStringVar$ ‘ process the line hereLoop

Determine the Last Day of the Month

This can be accomplished with just one line of code: FindEOM = DateSerial(Year(ADate), Month(ADate) + 1, 0) Setting the day parameter of DateSerial to 0 always returns the day prior