You can't call a method on a field outside of a method.
sample code:
class 1:
public class Test
{
public Test()
{
}
public void Sum()
{
Console.Write("hello");
}
public string sayhello()
{
return "hello";
}
}
class2:(creating object and calling methods)
public class testclient
{
Test obj = new Test();
void rt()
{
obj.Sum();
obj.sayhello();
}
}