Sunday 30 November 2008

Spotify.com

Every now and then you come across something that totally rocks. Spotify is one of those things. If you have not seen it then go check it out!!! Its like itunes but you have an almost infinite record box/ full ipod!! Just type in who you want to listen to and up pops their entire discography. Type the song name and get it - stright away no messing. Click on the bands name and find al the albums they have appeared on.

Want to listen - click play. Easy as that. It so slick and smooth.

Want to setup play lists for parties etc.. no problems.

Want to listen to some random stuff no probs.

Want to listen to the radio from a certain era - its there.

And how much does it cost? Nada... bugger all! Its FREE gratis!! With the free version you do have adverts every now and then but I've had one ad in about 3 hours. This may increase as its gets more popular but you have the option to buy a premium membership for £10 per month for ad free tunage.

All in all its absolutely mint! Its quick and responsive and you can skip through the songs like they were on your hard drive.

10/10 from me! well done.

There are a few bands such as metallica that wont sign up to it but no worries - you can listen to them other ways - or buy their stuff but to be honest there ain't been many songs I've not been able to find up to now.

Monday 20 October 2008

KB957095 Hotfix Breaks DFS access from Vista

I recently installed the KB957095 Hotfix on my Vista Ultimate and discovered it stopped me getting access to shares created using DFS over the network. On removing it i got my access back so at the moment i will stay with the vulnerabilty and have access to my data! Cheers Microsoft.

I believe the hotifx is related to SMB.

Thursday 11 September 2008

Versioning Workflows

A while ago i had a project where i used Windows Workflow Foundation. Fantastic tool but i hit several issues with it that put me off using it since. One of these issues was the complexities of hosting in iis and the other was the versioning of workflows. At the time i could not find any information to help me with this so did what i though was best at the time.

Today i noticed a blog post which covers the perfect solution to workflow versioning. You can read it here over at the problem solvers blog.



Here was my solution to compare - which wasnt ideal but sufficed at the time.

What i thought i needed to do was create a new copy of the workflow (at design time) and deploy both versions. This was fine but the next issue i had was how do i copy a workflow and make some changes. Heindsight says this was a bad move but it didnt jump out at me at first. Anyway.. I ended up copying the workflow xaml xml and changing the xaml to a new type - V2. And this actually worked!

Now i had old and new versions of the workflow and could make my changes and deploy.

The next issue i came across was code that was hooked into the workflow, i.e. any services/classes that made use of the workflow. You had to change the code to tell it what version of workflow to create, that was easy but then if you had referred to the workflow at any point in your classes, and this had been removed/changed then it would obviously break.

Thursday 4 September 2008

Getting Virtual Server 2005 R2 to work on Vista

Had a bit of a nitemare getting this to work properly but eventually got there.

First make sure you go into the Enable Windows features and switch on the following:

Under Web Management Tools enable:
IIS Management Console

Under IIS 6 Management Compatibility enable:
IIS Metabase and IIS6 configuration compatibility

Under Application Development Features enable:
CGI

Under Common Http Features enable:
Default Document
Directory Browsing
HTTP Errors
Static Content

Under Health and Diagnostics enable:
HTTP Logging
Request Monitor

Under Performance Features enable:
Static Content Compression

Under Security enable:
Windows Authentication

Then install Virtual Server.

Once installed open up the administration website in IE using the following link:

http://yourmachinename.yourdomain/VirtualServer/VSWebApp.exe?view=1

ALSO ENSURE YOU RUN IE as Administrator!!!!! This is a biggy and is what stumped me for ages! If you dont you will get the following error message:

Could not connect to Virtual Server. Access was denied.
You can specify an alternate Virtual Server below.

Also note that when you signed in you will have to login the following way:

username@domain

or domain\username

If you try and login with just username it will fail and give you the machinename.domain/username in the popup. This will still not work until you remove the machine name part.

Hope this helps you out.

Monday 28 July 2008

SSIS Package Execution from TSQL

I have been learning some SSIS and created a file transformation package to load and convert some data. I have come across 2 major headaches in doing so that i thought i would share.

1st - the deployment. This seemed so complex when i first set about doing it. If you follow the MS articles in BOL you will get most of the way there but they omit the part about security settings. When you deploy the build & deploy package id you encrypt sensitive data with user key it will now work as it will try and use your local workstation account which will not reside on the server. Basically you will need to tell it not to save sensitive data (property setting on the control flow page).

Also if you deploy the settings to a sql server table it appears to save the passwords encrypted! Truth is that it doeasnt save the passwords for user connections to databases etc! So the only way i found to get it to work is to store the password (which is in plain text) in the config! I just dont get that bit - just doesnt seem secure to me.

Next biggy was getting the package to run using the dtsexec util. I wanted to fire in the values for 2 variables i had to allow the package to be dynamic so i could re-use it for multiple files.

Here is the command line i tried running:

EXEC xp_cmdshell

'dtexec /DTS "\File System\DataLoad\DataLoad" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E /SET "\Package.Variables[User::FileName].Properties[Value]";"c:\data\01052008b.txt"'

Do you see the problem?? No - didnt think so. Its just not obvious. What you cant see from the text above is some CRLF's (line breaks) the i put in improve readability while i was debugging. Turns out that all that will get passed to the package is the text up to the first CRLF!!! Hence my /SET wasnt getting parsed!!

Talk about head/brickwall!

So make sure you keep your command executions on a single line! Even is its huuuuuge!

Thursday 29 May 2008

OPENDATASOURCE or OPENROWSET linked server Error fix

This drove me mental for a while.

If you are trying to open an external file such as a TXT, XLS, CSV using SQL's OPENROWSET or OPENDATASOURCE functionality and keep getting errors that look like the ones below then here is the fix/workaround.

The Errors:

OLE Database provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
returned message "Unspecified error".

Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE Database provider
"Microsoft.Jet.OLEDB.4.0" for linked server "(null)".


The fix:

I tried all the suggestions about SP2, restarting services, setting flags in the SQL settings etc but all to no avail.

What you need to do is visit the link below and download the

2007 Office System Driver: Data Connectivity Components download

Once downloaded and installed on the SQL Server you will notice a new driver in the list of drivers on the server at this path:

SERVER\Server Objects\Linked Servers\Providers

The new driver is called:

Microsoft.ACE.OLEDB.12.0

All you then need to do is change your SQL Query to use this new driver rather than the old Microsoft.Jet.OLEDB.4.0 one.

Your new connection string should look something like this:

OPENDATASOURCE(''Microsoft.ACE.OLEDB.12.0'',
''Data Source=C:\data\;
Extended Properties="Text;HDR=No;FMT=Delimited"'')...['+ @FileN +'#CSV]'

Voila! That should sort you out.

Wednesday 5 March 2008

Converting HTML to aspx tip

I need to convert some html to aspx. On the page were loads of images and as i moving stuff into master pages it was going to totally scre the directories up.

As you may know with a server control you can use the sqiggle/tilda (~) in a path so the server resolves the actual path for you when it generated the page.

What you can do to save a lot of time is rather than change all the image controls, for example, is just add a runat="server" to the html control and then do a search and replace on the image url to add the ~. This allows the existing alt text etc to be used without having to convert to a server control - which has different naming conventions for the attributes.

Find out what stored procs have changed

Been ages since ive posted on here as ive been in a cave working on a big project! Ive finally come out and found time to post something useful i found.

I wanted to know what had changed in a database in the last x days to check for things before i did a backup/restore so found the following queries useful!

This fella will tell you the stored procedures that have been modified in the last x days:

SELECT NAME ProcName, create_date Created, modify_date Modified
FROM sys.objects
WHERE type = 'P'
AND DATEDIFF(D,modify_date, GETDATE()) < 3 --Change 7 to any other day value
ORDER BY 3 DESC

This fella will tell you the stored procedures that have been created in the last x days:

SELECT NAME ProcName, create_date Created, modify_date Modified
FROM sys.objects
WHERE type = 'P'
AND DATEDIFF(D,create_date, GETDATE()) < 3
ORDER BY 2 DESC

Very handy!