Friday, 14 June 2013

JSON success!

<feeling smug/>

It's a simple thing I know, but here's a screenshot from my Android phone. I have written a web service that wraps the Project Sputnik Assets Business Layer and sends JSON data. The screen shot shows the data in my SQL database on my phone. I just need to put an Android UI together now that can consume the service and render it in a user friendly way!
 

Difficult printers in Windows 7

Ok, so here's another reminder for myself.
From time to time I come across systems that have printers "ghosted" in Devices and Printers. You right-click on them, select "remove" and they're gone .... only they're not! Next reboot, there they are again! Varmits!

It seems that Windows wont remove them if there are documents spooled and un-printed (doesn't matter how old) or sometimes if there are ports that have been created and associated with a printer that are still present.

These instructions help you to remove these pesky items!

  1. Right-click on the desktop, and create a new shortcut with a target of 'cmd.exe'
  2. Right-click on the shortcut and select "Run as Administrator"
  3. Run the printui tool with: printui /s /t2
  4. Try deleting the printers. If that doesn't work...
  5. Click Start > Run > Services.msc
  6. Locate the Print Spooler service and stop it (Right-click > Properties > stop service)
  7. Open My Computer and browse to C:\Windows\System32\spool\Printers
  8. (you will need to say "Continue" or "OK" to get access to this folder)
  9. DELETE the contents of that folder
  10. Restart the Print Spooler service
  11. Go back into the printui utility (might need to restart it using same method as above) and try removing the printers again. This time it should work. If necessary, check the "Ports" tab and remove any TCP/IP ports that are associated with the old printer
  12. Finally, check any other computers on the network to see if any have mapped to the printer. Remove any mappings

Tuesday, 4 June 2013

Calling a SPROC through ODBC with a DSN

This has caused me an issue today. I was creating an ODBC command object (correctly) with a connecting string (also correct) and calling a SPROC that needed two parameters. Again, I had added the parameters in the normal way (used MANY times before) but I kept getting an error "the query xxx requires parameter @yyyy which was not supplied". Turns out you have to re-structure the code as per the article below.


CSS 3.0 validation in Visual Studio 2010

It annoys me that CSS 3.0 validation is not included in VS 2010. At work we make heavy use of Virtual Machine for development environments and with each product release a new VPC Development Environment is created, and some time after that I will need to work on an ASP.NET project. I'll load up the project and get confronted with the usual VSS errors complaining that the Style Sheets contain validation errors because VS is validating against CSS 2.1.

The link below is where to download the installation files for the CSS 3.0 validation tool. Follow the simple installation and there you go!

http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83