和错误:基础提供程序在Open上失败。 [英] and error : The underlying provider failed on Open.

查看:962
本文介绍了和错误:基础提供程序在Open上失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我的下面代码出错:

hello i get error on my below code:

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();
            }
        }



和错误是:基础提供商在Open上失败。


and error is : The underlying provider failed on Open.

推荐答案

你需要更多地介入它,但它似乎说它无法连接到你的数据库。假设您拥有SportContext的源代码,请进入代码。
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.


- 底层提供者 - 失败 - 开放 [ ^ ]



检查链接..他们有类似的讨论..
the-underlying-provider-failed-on-open[^]

Check the link..they had the similar discussion..


这篇关于和错误:基础提供程序在Open上失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆