Listing tax names is a good start, but is not a convenient way to discover the appropriate taxes to apply. The TaxControls components provide a way to look up taxes using the workplace and residence ZIP codes, which will significantly reduce the number of taxes to consider.
- Enter Code
Enter the following code in a file named ‘Zips.cs’:
using System;using TaxControls;class Test{ public static void Main(){ try { CTaxControl tc = new CTaxControl(); int work=20500; int home=20301; String taxes=tc.TaxNamesForZip(work, home); foreach(String t in taxes.Split(",")){ Console.WriteLine(t); } } catch (TaxControlException e) { Console.WriteLine(e.Message); } }}
- Compile
Compile the code at the command prompt by executing the following:
\...\csc.exe /reference:TaxControls.dll Zips.cs
- Run
Run the code by typing:
Zips