I have declared three variables namely
TemplateData tData; TaskInstance tInstance;int tID;
in my program. Though I have clearly declared them, I keep getting an error “Use of unassigned local variable”
I am completely baffled as to why my compiler is giving this error.
Compiler is absolutely correct. Although you have declared them but Compiler did not tells you that “Use of undeclared local variable”. It tells you"Use of unassigned local variable"..There is difference between declaration and assignments of variables…
Assign the values to variables. In your code it should be
OR