Hi there,
I am pulling my hair out a result of what I sure is a simple issue.
In trying to implement the Select(ID) in the DAL technique in Chapters 2 and 3, I continue to receive am InvalidCastException error on returning the result from the LINQ query to the database object. I need help with the Cast or another technique. Is there a simple method to convert the iQueryable result to the TEntity object? Is this even the issue?
Code:
public override Application Select(string name)
{
using (fvLINQToSQLDataContext db = new fvLINQToSQLDataContext(DBHelper.GetForecastVelocityConnectionString()))
{
ISingleResult<Application> app = db.Applications_GetByName(name);
return app.Single();
}
}
}
Where Application is the name of the Data Class created when I added a table from my database to the Designer face.
Thanks!