First of all, you place the same code that you are trying to execute into catch. If something is wrong in try you should handle it in catch. With the code that you are doing up there is not correct.
The exception that you are getting indicates that; "you are trying to access member fields or function types on an object reference that points to null."
Have you debugged it and checked the values that you are having in your code?
A better understanding for this exception check this
link[
^].
For a proper try-catch block check this msdn
link[
^]
-or-
this
link[
^] helps you in a more simplified way.
Good luck,