Can anybody help me on this issue?
I set the ASP.NET Web application as start project and used the default setting for database connection. When trying to browse the product, I get the following error "The underlying provider failed on Open." at the highlighted line below:
public List<Product> GetProductsByCategory(int categoryId, string sortExpression)
using (var context = DataObjectFactory.CreateContext())
// Load single Category with all Product child records
var category = context.CategoryEntities.Include("Products")
.FirstOrDefault(c => c.CategoryId == categoryId);
// Order by (using dynamic linq) without going back to db
var products = category.Products.AsQueryable().OrderBy(sortExpression, null);
// Return list of business objects
return products.Select(p => Mapper.Map(p)).ToList();
I am running this project using VS 2010 Professional on Windows Vista.