Home

Get the ID for the last inserted record

When you’re dealing with SQL Server doing inserts, you commonly want the identity to be a number which increments from 1. But one of the problems with this being automatically incremented is that you don’t immediately know what the ID for the last item you added is. SQL Server provides the capability for you to get this information by using the...

Read more

Sending an email from a .Net application

This is something that I found myself doing over and over again so I decided to create a class that simplified the process of sending an email from a .Net application. As mentioned in the comment, feel free to use this code within your applications, the only requirement is that you leave the comment in place. I also wouldn’t say no to getting a...

Read more

Get the mid point between two date times

I have been asked how to do this a couple times now, so I thought I would post a function that deals with getting the mid point between two date times. Public Function getMidDateTime(ByVal dt1 As DateTime, ByVal dt2 As DateTime) As DateTime     Dim rtn As DateTime     Dim diff As Integer     diff = DateDiff(DateInterval.Second, dt1, dt2)     rt...

Read more

SQL Server list columns in table

This is one method of getting a list of all the columns in a table on SQL Server SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=@TABLE_NAME

Read more

Reserved words in VB.Net

The following is a list of words that should not be used in VB.Net for variable names as they are already used as part of the VB.Net language. AddHandler AddressOf Alias And AndAlso Ansi Append As Assembly Auto Binary Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate CDec CDbl Char CInt Class CLng CObj Compare CShort CSng CStr CT...

Read more

How to zero the free space on your hard drive on Linux

The reason you’re reading this tutorial is probably because you have read about how when you delete a file it isn’t actually deleted only the pointer which tells the OS where to find the file is deleted and you want to reduce the chance of someone being able to recover files that you have deleted from your computer (please bare in mind that the ...

Read more

How to fill your hard drive up with random bits on Linux

You have probably read about how when you delete a file it isn’t actually deleted, only the pointer which tells the OS where to find the file is deleted. As people who want to ensure that our data is as secure as possible we don’t want those files just lying around waiting for someone to find your deleted porn stash sensitive files 😉 You may ha...

Read more

Create a bit for bit backup of a default installation

So if any of you are like me you find yourself re-installing Windows/Linux every few months to keep it all nice and clean and get rid of any crap that I’ve picked up since the last install. If you are then you’ll know the annoyance of having to re-install all your software etc. so I decided to create a tutorial for those people who are like me ...

Read more