Accèsrevusé。 (例外de HRESULT:0x80070005(E_ACCESSDENIED)) [英] Accès refusé. (Exception de HRESULT : 0x80070005 (E_ACCESSDENIED))

查看:102
本文介绍了Accèsrevusé。 (例外de HRESULT:0x80070005(E_ACCESSDENIED))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个错误,我想连接到我的数据库这是代码的一部分PLZ帮助我



i have an error whene i want to connect to my DB this's part of code plz help mee

public static void Connecter()
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
        }





ligne con.Open();



the eror apear in ligne con.Open();

推荐答案

好好查看你的连接字符串:可能是它使用了错误的凭据。



尝试设置VS中与服务器资源管理器窗格的连接:

1)打开服务器资源管理器。

2)右键单击数据连接并选择添加连接

3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接按钮。

4)当连接正常时,按确定

5在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。
Have a good look at your connection string: the chances are that it is using the wrong credentials.

Try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.


这篇关于Accèsrevusé。 (例外de HRESULT:0x80070005(E_ACCESSDENIED))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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