This gives me error..how to solve this...
class nameex
{
public object call()
{
dynamic expando = new ExpandoObject();
var p = expando as IDictionary<String, object>;
p["Demo"] = "New val 1"; }
}
}
class de
{
dynamic n = new nameex();
x.call();
n.Demo = "Welcome";
Console.WriteLine(n.Demo);
}

Please use code tags around your code.

There are several errors with this code:

1) call() does not return a value, it should return an object
2) I am not sure why you are using the 'dynamic' keyword for your expando object, could you not simply use 'var' or its actual type?
3)class de contains no methods - rather it looks like you wrote a method as the class body.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.