C# example gives error message

Thanks for the reply