Bitwise Operators

Visual Basic has never had operators for performing bitwise functions until now, that is. The following table shows the three bitwise operators available in VB.NET. Both left and right side of the operator Either left or right side of operator is 1 Either left or right side of operator is 1, but not both As a refresher, the following table shows the four possible combinations of left and right sides of bitwise operators and the result of each

Legal Stored Procedures

The stored procedure code can be found in folder prjStoredProcedures. Most database programmers learn the power and usefulness of the stored procedure as they become familiar with client-server programming. Stored procedures are chunks of code that are written in Transact-SQL that run on the database server machine, as opposed to the client machine. When your database server is a 20,000, multiprocessor box, and your client is a 1,200 box, which one should you choose to perform most of the...

Screen Capture

Many screensavers appear to be drawing their effects right over the top of your word processor, email program, or whatever applications you happened to have open when the screensaver kicks in. In truth, this is a cleverly disguised trick. Most screensavers perform this trick by grabbing an image of the screen, copying it onto a bitmap, and then drawing on that bitmap. In the Win32 environment, there were several API-based methods for grabbing the Desktop window handle for the purpose of...

Watching for Files

I decided to use a form-level property for this project to track the directory that I wanted the FileSystemWatcher to watch. Properties are useful because you can place code inside the Set procedure, which causes the code to execute whenever the property changes. Here is the code for that form level property Property pFolderName As String Get pFolderName llFolderName.text End Get oWatcher New tagFileSystemWatcher oWatcher.Path Value oWatcher.IncludeSubdirectories False 'oWatcher.Target...

Still More Binding

The binding code can be found in the folder prjBindingToACollection. You've seen how binding works on the database-like DataSet. This construct makes it easy to load information out of a database and into a DataSet residing as some form of middle tier object perhaps and use the DataSet to bind to presentation tier controls. Binding is not limited to DataSets, however. You can bind your own classes and custom collections to UI controls. This is useful because not all applications are database...

Speed Reading Using the DataReader

The DataReader code can be found in the folder prjDataReader. The workload of the database programmer can be summed up in a few simple words read the data, display the data, edit the data, and write the data. The details under these broad tasks vary widely from project to project, of course, depending on the type of application 1-tier, 2-tier, n-tier , the structure of the data itself, the desired user interface, and many other factors. However, the read edit write cycle of the typical database...