Recent twitter entries...

Quick way to write to the event log from your C# applications

Posted in C# | Posted on 26-10-2011

Namespace to import

using System.Diagnostics;

Code to write to the application log, sure this is super simple but sometimes that’s all you need ;)

const string sSource = "Your Application name..";
const string sLog = "Application";
if (!EventLog.SourceExists(sSource))
  EventLog.CreateEventSource(sSource, sLog);
  EventLog.WriteEntry(sSource, "Text you want in the entry here",
  EventLogEntryType.Information, 0);

The importance of user friendly interfaces on web-apps!

Posted in Funny Videos, Recommendations | Posted on 21-10-2011

Check this out, it’s hilarious and illustrates why site owners need to make the user experience a little more streamlined.

I got the usability book “Don’t make me think” pretty much when it came out and think it’s a great read for any application developer that acts as a user interface.


Create a million rows in no time at all

Posted in SQL Server | Posted on 14-10-2011

Perhaps there’s a point to this, but not for me today – but maybe in future or for you today?

create table #t (a int)
create table #A (a int, b int)
create table #B (a int, b int, C int)
create table #C (a int, b int, c int, D int)
create table #D (a int, b int, c int, D int, e int)
create table #E (a int, b int,c int,d int,e int,f int)
insert into #t
select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9 union all select 10
– 100
insert into #A
select t.a,t2.a
from #t t cross join #t t2
–10000
insert into #C
select t.a,t.a,t2.a,t2.a from #A t cross join #A t2
– 1000000
insert into #E
select t.a,t.a,t2.a ,t2.a ,t2.a ,t2.a from #A t cross join #C t2

/*– clean up
drop table #t
drop table #A
drop table #B
drop table #C
drop table #D
drop table #E
*/


Update iPad to iOS5 without losing any data like iBooks pdfs

Posted in Ramblings | Posted on 13-10-2011

Thought I would take the plunge and go for the iOS 5 update on my iPad 2, the main thing I was worried about getting wiped as part of the dreaded sync (I started using iTunes on a PC at my old job….).

I found a program for windows called iExplorer, which seemed to bring up the iBooks directory and I could copy and paste all my 48 treasured programming PDFs over to windows in the way you would expect to do by default… except the file names had all been mangled into unreadable names but still the PDFs are intact.

Then I run the update in iTunes…. and what a shock, 45 minutes later its all done and dusted… all my apps still there.. all my iBooks PDFs still there… games with progress still intact… such as asphalt 6 adrenaline….

Bloody delighted… couldn’t have been smoother in the end!


Save SQL Server login details in SQL Management Studio

Posted in Recommendations, SQL Server | Posted on 11-10-2011

Today I found out something that I found out years ago, if you like me need to use multiple SQL servers but can’t remember things by IP address or would prefer not having to type login information every time you want to connect then use registered servers.

Registered servers allow you to easily check if a server is running, create groups of servers, use user-friendly names for your servers, and import/export your registered server groups.

To view and add a registered server, start up SQL Server Management Studio go to View > Registered Servers. Then in the Registered Servers pane, right-click Local Server Groups and click New Server Registration. Alternatively if you already have them open right now you can just right click the instance and select register then enter your friendly name… super easy!

SaveSQLServerPasswords Save SQL Server login details in SQL Management Studio


Then just enter the server name, select the authentication, key in the User name and Password if necessary, and check Remember password.

Now each time you start up SQL Server Management Studio, your registered servers will be viewable in the Registered Servers pane. Simply double-click the server you wish to navigate and that server will be opened within the Object Explorer.

Now I need to find out how to make this the default view when opening SSMS..