Dofactory.com
Dofactory.com
 Back to list
Views:   49K
Replies:  2
Archived

Need some help with "The underlying provider failed on Open"

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.

Thanks.
 
Steven Cai, Mar 12, 2011
Reply 1
Thanks to the author..Best article...Here is my discussion on MSSQL underlying provider fialed error! Please visit! 

http://www.wikitechy.com/fix-error/mssql-error-the-underlying-provider-failed-on-open
Venkat J, Jun 11, 2016
Reply 2
Steven:

Here is a discussion on the same error:  http://stackoverflow.com/questions/2475008/the-underlying-provider-failed-on-open
From reading this article I suspect it is related to a MSDTC setting on your machine.

I hope this gets you going.
Dan McMillan, Mar 12, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.