I have a function where I need to retrieve a Table view of my data.
As I need to bind the data to a grid I need the results as a Table.
internal static Table<MyObject> GetUsersData()
{
var db = new DataContext();
var results = from user in db.Results
where user.Type == "USERTYPE"
select user;
return results;
}
if I was to get the whole table it works fine as it retrieves the table as a Table.
var results = db.Results;
The error I get is
Error 6 Cannot implicitly convert type An explicit conversion exists
Is there a way to cast the results into a table?
Im trying to bind this data to a grid, Im starting to think I should create a View on the database.
Have your method return:
IQueryable<Result>