**Here is my code:**

I should get output of the department id (did) as an integer and the templatefilename (result) that is required. 

The errors I get are: Conversion from string "ad" to type 'Integer' is not valid. I'm fairly new to asp.net and cannot see where the did variable picks up the "ad" string.

Any help would be greatly appreciated.

Thanks