10. March 2011 19:28
I am sure you have come across tally tables on firums or other sources of information on the internet. But what are they for?
The answer to that is really simple. It give you a basic range of numbers that you can reference.
So here is a really quick way to build a tally table.
SELECT TOP 1000000
IDENTITY(INT,1,1) AS N
FROM sys.all_columns a1, sys.all_columns a2
ALTER TABLE Tally
ADD CONSTRAINT PK_Tally
PRIMARY KEY CLUSTERED (N) WITH FILLFACTOR = 100
10. March 2011 18:50
Almost every windows program that is written for windows at some stage needs to save some settings ... Somewhere. Some method are better that others depending on what needs to be be saved. Here is a method todo that by serializing an entire class and saving it in the user app data folder on their computer.
It does not require much to enable this sort of functionality. Though it can be far superior to the existing set that exists by default in visual studio as it allows you to save an active data state for example and then when the program restarts it's possible to continue from where you left off.
7. March 2011 19:49
Here is a quick set of functions that will allow you to reboot / shutdown / logoff windows from c#
I was flicking though some things on another asp.net / c# and stumbled across the following post. It is aimed at providing a solution in VB.NET to reboot a computer. However I think its a pretty poor attempt at solving the problem so I have been digging though my code base and found the following solution.
5. March 2011 11:49
I am not sure why but i seem to be getting a lot of these recently. I always seem to find them quite funny since I run my own email server.