Better don't violate naming conventions: your interface should be named
IGrid
. It won't fix your problems but will make life easier. :-)
Also, don't use the word "class" in the name of the class. Isn't it obvious?
I agree with Sinisa Hajnal: you don't show the all the code helping to figure out why
obj
is null, but you can easily find it out under the debugger. Your problem is different: understanding. If you want to use interfaces, actually use them.
Consider this:
public class GridImplementationClass : AdminPerformanceIncentive, IGrid
{
DataTable IGrid.Gridbind(string FromDate, string ToDate) { }
}
GridImplementationClass @object = new GridImplementationClass();
IGrid grid = @object;
DataTable dataTable = grid.Gridbind();
Are you getting the point?
—SA