Greek VAT validation number code
.net, vb.net, visual-studio-2010, windows
Solution
It's not EU laws that makes it 9 digits, it depends on the country.
Unfortunately I don't know if you can get hold of the algorithm anywhere and even if you could, that still wouldn't mean that it was a valid VAT number. The only way that I know of to be sure that it's a valid VAT number is to validate it against the webservice as mentioned in Rup's comment. So if you're going to use this validation to decide if you're going to charge VAT or not, I'd not trust just a calculation since then you might end up breaking the rules (and possibly having to pay VAT that you haven't collected...).
There's a code project article showing how to use it (C# but should be relatively easy to convert to VB.Net if needed): VIES - VAT number checker
Though obviously it might be worthwhile checking for 9 digits first to rule out any obviously invalid ones.
Problem
Is there anybody which can assist me with a code in VB.NET visual studio 2010 for validating Greek TAX Registration number (VAT).