Jump to content

Check out our Community Blogs


Member Since 22 Oct 2012
Offline Last Active Jun 28 2017 11:09 PM

Blog Entries

Barnsite's Blog > Don’t Fall Victim To The Windows / Microsoft Phone Scam!

Posted 14 June 2017

There are many phone scams where someone will ring you claiming to be from Microsoft, Dell, Apple, or some other known IT company.They will tell you that they have detected issues with your computer, normally “security” issues.They will often ask you to open the “Event Viewer” on your computer to show you the errors.They will then ask you to go...

Barnsite's Blog > Remove Characters in String T-SQL with No Loop Part 2

Posted 09 May 2016

Okay, expanding on what I did yesterday.I Built a table, called ExclusionList with one field, ExcludedTextE.g.Then created a function:CREATE FUNCTION [dbo].[udf_clean_string] ( @string VARCHAR(100) ) RETURNS VARCHAR(100)ASBEGIN SELECT @string = REPLACE(@string,ExcludedText,'')FROM ExclusionListRETURN @stringYou can then use like this:SELECT d...

Barnsite's Blog > Remove Characters in String T-SQL with No Loop

Posted 09 May 2016

Ok, I’ve seen many ways to do this using loops, but nothing in plain T-SQLLet’s say we have a string that may contain illegal characters, in my case it was project identifiers that needed to be used as file names for exporting. However, many had / or * in the names.One thing I hate in T-SQL is loops, so having only found looping ways...

Barnsite's Blog > Add child items to ToolStripMenuItem using C# – C Sharp

Posted 22 January 2013

I wanted to be able to populate menu items from a database, i.e. I had a Print Document top level menu item and I wanted to be able to populate the children from the database dynamically with each available document.
The theory was this:
1. Use the MouseHover event for the main menu item
2. When the user hovers over the item, get the list of...

Barnsite's Blog > Shuffle an Array in C#

Posted 15 January 2013

As part of a basic guessing game I wanted to be able to shuffle an array of n chars into a random order.
The method I decided to use was the following.
Create a loop to iterate n times (where n is the number of elements in the array).  Randomly select one array element and add this to a new array.  Replace the removed item with the last item in...