Cannot assign <null> to implicit types a local variable using asp.net
I have it
var result = general.GetInformation(int.Parse(ID), F_account, F_Info, Types); this GetInformation is my Entity.Getinformation class .. when I try to assign the result globly, I get Can not Assign for an implicit typed local variable?
var result = ? What should I assign globally?
thanks
+4
4 answers
When you say "assign the result globally," do you mean using it as a class variable?
class SomeClass { var result = general.GetInformation(int.Parse(ID), F_account, F_Info, Types); } In this case, you cannot use var , and you will need to use the GetInformation return type, for example
string result = general.GetInformation(int.Parse(ID), F_account, F_Info, Types); or
Entity result = general.GetInformation(int.Parse(ID), F_account, F_Info, Types); +3