How does one export the contents of a datatable to an Excel spreadsheet? There is a bunch of sample VB.Net code on the net that deals with this – the exporting the contents of a System.Data.DataTable to a comma-delimited file (CSV or more commonly referred to as Excel) via an ASP.Net website. It’s pretty straight-forward… [Read More]
Data Binding EVAL
I found a neat little trick this past week. Probably something that all other programmers that are using data binding already knows… In short, I needed to show JavaScript Confirm popup following the click event of a LinkButton contained in a GridView on an ASP.Net 4.0 framework web site page. If not familiar, a Confirm… [Read More]
T-SQL Week End Dates
Occasionally, when querying for report data, you need to divide the data into weeks. This function returns a table that contains the date of the end of each week that ends in the specified month. The function consumes two other functions that use statements specified in this T-SQL Begin Date post and this T-SQL End… [Read More]
T-SQL End Dates with DateAdd
We covered some “begin” T-SQL DateTime routines in this previous post. This time around, we’ll do some end date routines using DateAdd. The concept is the same; when developing stored procedures, functions, and scripts for a Microsoft SQL Server database, you often need these values, particularly when reporting and/or searching date ranges. Function that returns… [Read More]
T-SQL Begin Dates
When programming stored procedures, functions, or just writing queries for Microsoft SQL Server databases, we often need date variables set to the beginning or end of a day, week, month or year. This is commonly done by concatenating strings – such as: DECLARE @InputDate DATETIME SET @InputDate = ‘4/1/2004 ‘ + ’00:00:00’ That works but… [Read More]
Interface Programming
I don’t see much talk of interface programming/development these days so I thought an example might help someone. All that is written here applies equally to all the Microsoft .Net languages (VB.Net, C#.Net, etc…) and the different types of software graphical user interfaces, ASP.Net web sites, Windows services, etc…). What is an interface? In basic… [Read More]
More Object Serialization
In my first and second postings on serialization, I focused on the basics of the concept. This time around, I want to give you some additional tips that I learned the hard way. As always, the System.Runtime.Serialization namespace or System.Xml.Serialization namespace is required and all of this is applicable to all of the .Net languages (VB.Net,… [Read More]
SQL Common Table Expressions
I’ve been working with Microsoft SQL Server Common Table Expressions (CTE) lately and am totally impressed every time. My most recent experience was needing a temporary table with the fixed number of rows into which I would load some data based on the row number (basically). There are several ways to accomplish this with T-SQL. … [Read More]
What is SQL?
There are probably a hundred valid answers to this question. Nonetheless; I run into the question fairly regularly and also see some rather inaccurate beliefs about it. Let’s define some terms, I’ve attempted to order them in an order that helps with understanding. “RDBMS” is an acronym for Relational Database Management System. “SQL Server” is… [Read More]
IF or IIF
The IIF function in Microsoft VB is a statement that allows you to evaluate an expression and return one of two objects depending on the result of the evaluation. Neat. The problem that I had with IIF is that it always evaluates the true and false parts of the statement no matter the result of… [Read More]






