AddStock' is a 'type' but is used like a 'variable'

as is not allowed as name for a variable, because it´s a keywors used in C#. you´d better be off by use another name, e.g. ÀddStock`.

If you really need/want to use that name use the @ in front:

AddStock @as = new AddStock();

But then you´d have to add that operator whenever you´re using that variable, e.g. the following would cause a compiler-error:

as.DoSometing();

whereas this won´t:

@as.DoSomething();

Browse More Popular Posts

Leave a Comment