devxlogo

Tip Bank

Managing Custom Errors in SQL Server

Creating Custom Errors in SQL Server is not a hard thing to do, but managing those errors across multiple developers can be difficult. The question becomes: who has already used

Never Use L”” to Create a BSTR

When you call a COM method, it accepts BSTR in the following way: Iface->f(L””) L”” does not create a BSTR. This just creates a wide character string and if the

Use Math.PI and Math.E for Scientific Calculations

Many scientific/trigonometric/mathematical applications need the values of ‘pi’ and ‘e’ (the basis of natural logarithms) for calculations. The math class in the java.lang package has two static double constants that

Many Primary Keys for a Single Table

Have you ever wanted to have 1:1 relation between tables (i.e. a table in which two columns act like primary key not combined but separately)?DB only supports a single column,

Check for Available Memory Programmatically

If an application’s behavior is dependent on the amount of available memory, then this code fragment can be used to determine what action an application should take. For example, a