Jump to content

Check out our Community Blogs

Barnsite's Blog

Browse for SQL Server 2008 R2 Installation Media

  Posted by Barnsite, 03 December 2012 - - - - - - · 1603 views
When running the SQL Server Installation Centre I was receiving the above error.  This seems to be caused by the software being installed to a temp folder which is subsequently deleted post install.
Mine had been installed from a folder on the network.  Even pointing to this folder when prompted didn’t resolve the problem.
Solution that worked for...

SQL Server 2008 R2 Maintenance Cleanup Task Not Deleting bak Files

  Posted by Barnsite, 30 November 2012 - - - - - - · 564 views
I noticed that my old backup files were not being deleted despite my Cleanup Task being set to delete all bak files more than a day old.  Having checked, and double checked the path, file age, etc. I decided it was time to try a couple of random things.
Firstly I added a  to the file path, this seemed to make no difference.  So I then decided to remove the...

Multiple OR’s in T-SQL WHERE Condition SQL Server

  Posted by Barnsite, 30 November 2012 - - - - - - · 685 views
Just been rewriting some SQL Server stored procedures for a client. There were a lot of SELECT statements like the one below:

WHERE (field1 = 'SBO' OR field1 = 'RBO' OR field1 = 'PYO' OR field1 = 'TCO'
   OR field1 = 'BRS' OR field1 = 'BMS') AND field2 = 'COMPLETED'...

Null Dates in SQL Stored Procedure called from C# – Conversion Error DateTime2 DateTime

  Posted by Barnsite, 29 November 2012 - - - - - - · 1247 views
One issue with calling stored procedures from C# is with null date parameters.  If you try to pass an unassigned DateTime type to the parameter you will receive an error regarding conversion of DateTime2 to DateTime data type.
One way around this is to use the Nullable DateTime in C#
Lets assume we have the following table (dbo.Fault):

Assign Event to Multiple Controls, Windows forms and C#

  Posted by Barnsite, 26 November 2012 - - - - - - · 919 views
Lets say that you want the same event to be triggered by multiple controls. You don’t want to have to rewrite the code for all the controls.
Here we’re going to use four buttons with one shared event that shows the name of the button that’s been clicked.
Firstly create a form (in this case Form1) and add four buttons (button1, button2,...