尝试连接数据库时出现异常 [英] getting an exception while trying to connect to database

查看:73
本文介绍了尝试连接数据库时出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到C#中的数据库

我收到以下异常
此故障可能是由于默认设置Sql Server不允许远程连接引起的."

发生异常的原因是什么以及如何克服它.

请帮助SQL的新手...

I am trying to connect to a database in C#

I am getting the following exception
"this failure may be caused due to default settings Sql server does not allow remote connections."

what is the reason for the exception and how to overcome it.

Please help am new to SQL...

推荐答案

可能是您的连接字符串(可修复)或数据库设置(可能不可修复).

在VS中,打开服务器资源管理器"窗格(菜单:视图...解决方案资源管理器).您的SQL服务器在列表中吗?是你的数据库吗?如果是这样,请右键单击数据库,然后选择属性".在属性窗格中,是连接字符串".将其复制并粘贴到您的应用程序中(希望在设置文件中),然后看到f可以解决问题.

如果不是,那么您需要检查数据库是否支持与数据库管理员的远程连接-因为我不知道您的SQL Server在哪里,所以我在那儿无能为力!
Probably, either your connection string (fixable) or your database settings (may not be fixable).

In VS, open the Sever Explorer pane (Menu: View...Solution Explorer). Is your SQL server in the list? Is your database? If so, right click the database and select "Properties". In the properties pane, is the Connection String. Copy and paste this to your application (hopefully in the settings file) and see f that cures the problem.

If it doesn''t, then you need to check if the database supports remote connections with your Database admin - since I don''t know where your SQL server is, I can''t help there!


此故障可能是由于默认设置导致,Sql server不允许远程连接."
您的表面积配置未配置.

在此处查看设置外围应用配置的步骤..
"this failure may be caused due to default settings Sql server does not allow remote connections."
Your surface area configuration is not configured.

See steps for setting up Surface area configuration here..


这篇关于尝试连接数据库时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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