Justin Cooney

Web Development Tips and Examples

  • Background:

    Lately I have been playing around with HTML5 and CSS3 while building a Web Site UI for a corporate Intranet. I am guaranteed that users will be using IE, so I am happily able to tailor my code directly for IE 9.

    The caveat to using CSS3 rounded borders in IE is that they are only supported in IE 9+. IE 8 and earlier browsers will not accept the style and the borders will appear square without workarounds.

    How to Round your Table Borders (in IE):

    It’s great how one can now round borders on tables with a simple CSS property.

    For example to add a slight rounding effect to the top left and right borders of your table you can use the following style: (more…)

  • VB.NET supports several type conversion functions. Widening conversions are handled by the compiler and don’t need to be explicitly written, but narrowing conversions require use of VB.NET’s type conversion functions.

    The three type conversion functions are:

    • DirectCast
    • CType (and CInt, CStr,…Cxxx)
    • TryCast

    The compiler may not report an error if you code a narrowing conversion by accident. This is because Microsoft set Option Strict to be OFF for VB.NET projects (compared with C# projects where it is on). I think this was done to make upgrades from VB 6 easier to do since in VB 6 there was no Option Strict statement.

    (more…)

  • Running an ad-hoc query from SQL Server SSMS to an Excel spreadsheet is amazingly straightforward using the OpenRowset command.

    Here’s how it’s done…

    For starters, copy the Excel spreadsheet to a location where the installed version of SQL Server can access it. This is necessary since your query in SSMS (SQL Server Management Studio) will not execute from your local machine. The query will be passed to SQL Server, which will then attempt to locate the spreadsheet as an OLE DB data source in order to run your query on it.

    So make sure that the Excel spreadsheet is located either on the computer SQL Server is installed on, or on a network share which the SQL Server account has access to.

    Step two is to open SSMS, connect to SQL Server, and open a query window in SSMS where you can run your query from.

    (more…)