Has anyone come across an error like the following:
Unable to cast object of type 'CompaniesDataTable' to type 'CompaniesDataTable'.
Here is the code that is causing the error:
protected void ObjectDataSource_Companies_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
int x = ((Adala.CompaniesDataTable)(e.ReturnValue)).Count;
}
What I'm trying to do is to get the total number of rows of gridview returned by the objectdatasource but it gives me that error.
Why is it not able to cast type to the same type?