Sunday 27 March 2011

Text Type Deprecated in SQL Server 2008 and above

How to handle MS SQL Text type data now that it is deprecated


The text type, which was always a special case when creating triggers, stored procedures and the like is depracated from SQL Server 2008.

To update systems, replace the TEXT type with VARCHAR(MAX) or NVARCHAR(MAX)

In vb.net, change the parameter declarations from TEXT, to this
        cmd.Parameters.Add("@Notes", SqlDbType.VarChar, -1).Direction = ParameterDirection.Output

Wednesday 23 March 2011

New Features In Visual Studio 2010

A partial list of some of new features in Visual Studio 2010 that I think I will find useful


1) Auto-Implemented Properties
For my database derived code I automatically generate all the properties anyone, but other than that declaring properties with their corresponding Get/Set methods is one of the least exciting tasks. Microsoft have made it easier with auto-implemented properties.
Simply declare the property like this:


   Property ClientID as Integer 


Visual Studio will automatically generate a hidden private member, and Get/Set methods

To make them visible if you need to customise them, for example, to add some validation, then type G or S on the line after the property declaration and VS will show the hidden methods.


2) Reference Highlighting
This will be a feature that I will miss when I work in previous editions of Visual Studio. When you click on a keyword, all instances of it are highlighted.
But much more usefully, when clicking on part of a construction such as a If..Then, all parts of that construction are highlighted. I think that this will be most helpful when working with nested statements.


Some features I am not so sure about:

  • Lambda Expressions - these could make code harder to read, and the time savings over regular functions are minimal.

Tuesday 22 March 2011

Google Cloud Connect

Today Carl Hughes of IT Hound recommended Google Cloud Connect.
This wonderful piece of technology allows me to use Microsoft Word and Excel, but have them synchronised to Google Documents. This gives me the benefit of having access to my documents from any internet enabled application and being able to collaborate on them with others, but still having the powerful editing capabilities of Microsoft's Office Suite.

Its easy to set this up
1)  simply download and install the Cloud Connect tool from here:
http://tools.google.com/dlpage/cloudconnect
2) Open Word or Excel and login to your Google Apps/Docs account
3) You can then choose to synchronize any document you create, and it will appear in your Google Documents account.

However, in testing this, I could only get it to work in one direction, from Word up-to Google Docs. Subsequent edits in Google were lost. 

Sunday 20 March 2011

Janus Winforms Suite and Visual Studio 2010

I have used Janus Winforms 2.0 and 3.5 with Visual Studio 2003, 2005 and 2008.


However, with Visual Studio 2010, when I tried to add Janus controls to a form, I found they were all disabled.


Investigating this I found that only Janus 4.0 will work with Visual Studio 2010.