July 27, 2002

Faster string comparison with the Is operator

.NET strings are objects, so what you store in a String variable is actually a reference to a String object allocated in the managed heap. Even though the VB.NET compiler attempts to hide the object nature of strings as much as it can – for example, you don’t need to

Faster string comparisons with CompareOrdinal

You can compare strings in many ways under VB.NET: by using the = operator (or another comparison operator), with the Equals method (which the String class inherits from System.Object), or with the Compare shared method. The Compare method is especially useful because it returns an integer that tells whether the

Disable .NET security

The .NET Framework enforces secuity at several levels. For example, assemblies downloaded from the Internet have very limited permissions (especially after installing the Service Pack 1 of the Framework). This means that many operations that would be legal in some cases may throw an exception in others. In general, the

Prevent a second process instance from running

VB6 developers can use the App.PrevInstance property to check whether there is another instance of the same process already running on the current machine. This property isn’t available any longer in VB.NET, so you must retrieve this information by using the properties of the Process object.The easiest way to do

Process individual pixels of a bitmap

While you can access individual pixels of a bitmap by means of the GetPixel and SetPixel methods of the Bitmap object, in practice you seldom want to use these methods, as they are simply too slow for most cpu-intensive operations. Fortunately there is a faster way, which consists of moving

Get the Current DataTime in Your Palm Application

It is a common feature in an application to require the current date time to be displayed in a text field or something similar.This can be done easily in PalmOS in two steps: The code is given below:-UInt32 iTime = TimGetSeconds ();DateTimePtr dateTimeP;TimSecondsToDateTime (iTime ,dateTimeP); TimGetSeconds returns the current date

Open Excel Sheet Data as a Recordset Using ADODB

‘****************************************************’Written By KNR’Excel Sheet Reading’Read Excel File Using ADO’You can use Microsoft EXCEL Driver’****************************************************Public Function Read_Excel(ByVal sFile As String) As ADODB.Recordset On Error GoTo fix_err Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim sconn As String rs.CursorLocation = adUseClient rs.CursorType = adOpenKeyset rs.LockType = adLockBatchOptimistic sconn = “DRIVER=Microsoft

Shrink the Transaction Log of a SQL Server Database

Shrinking a transaction log in SQL Server can be tricky, especially if you need it shrunk ASAP. You could use DBCC SHRINKFILE() to shrink it, but it will not shrink immediately, depending on where the physical log is placed amongst the virtual log. The following script can be used to

Using MS Access Database Through JDBC:ODBC

You can easily connect to a MS Access database by using JDBC. First, you need to set up the data source for your MS Access database using the ODBCAdministrator. You can find the ODBC icon in the Control Panel. For example, say you have a database booklist.mdb, you set up

No more posts to show