Click here to Skip to main content
16,021,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello i get error on my below code:
C#
public static IEnumerable<tbl_index_menu> PutParentInMenuTop()
        {
            using (SportContext db = new SportContext())
            {
                return db.tbl_index_menu.Where(z => z.parent == 0 && z.id_position == 1 &&    z.name_menu != "home").OrderBy(z => z.orderlist).ToList();
            }
        }

and error is : The underlying provider failed on Open.
Posted
Updated 30-Jul-13 18:26pm
v3
Comments
[no name] 30-Jul-13 18:28pm    
Check your connection string.

You'll need to step into it more but it appears to be saying it can't connect to your database. Step into the code assuming you have the source code for SportContext.
 
Share this answer
 
the-underlying-provider-failed-on-open[^]

Check the link..they had the similar discussion..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900