cannot assign <null> to implicit types local variable using asp.net

user354625 picture user354625 · Jun 18, 2010 · Viewed 15k times · Source

I have this

var  result = general.GetInformation(int.Parse(ID), F_account, F_Info, Types);

this GetInformation is my Entity.Getinformation class.. when I am trying to assign result globly I am getting Cannot Assign to implicit typed local variable?

var result = ?

what should I assign in global?

thanks

Answer

Gabe picture Gabe · Jun 18, 2010

It sounds like you're trying to do var result = null; which won't work because null doesn't tell the compiler what type result should be. You would need to use Sometype result = null;.