无法连接到SqlServer数据库 [英] Cannot connect to SqlServer Database

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

问题描述

大家好,我可以向您介绍一下有关ASP.NET和SQL SERVER 2005的连接。这些天我一直在使用ASP.NET中的Web服务。在我将所有数据和代码输入项目之后,我发现我的网站无法连接到SQL
SERVER DATABASE。由于我已经尝试过本书,网络以及一些熟悉的人,我认为你们可以提供帮助。

 情况是这样的:<登记/>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;我的操作系统是winxp(x86)。我工作的软件
是Visual Studio 2008.我在Lan Network工作。我使用Lan管理员创建的帐户登录我的电脑。连接url很好,我用一个简单的winFormApp测试它。我只是通过这本书来构建这个连接环境:


  1,安装.net Framework SDK v2.0;

  2,使用SDK_cmd做aspnet_regsql;

  3,我做了VS 2008中的例行工作:工具 - >选项 - > DATABASE工具 - >数据连接 - >输入SQL Server然后名称,工具 - >连接到DATABASE - >输入服务器名称 - >选择Windows身份验证 - >点击TEST(结果
显示成功)。

  4,打开IIS(我的IIS版本为5.1) - >右键单击默认网站 - >物业  - > ASP.NET - >点击编辑全局配置  - >&NBSP;一般&NBSP; - >&NBSP;点击连接字符串管理器  - >&NBSP;选择
LocalSqlServe 的R - >&NBSP;使用正确的URL更改右侧的字符串 - >申请;

  5,打开IIS(我的IIS版本是5.1) - >右键单击默认网站 - >财产&NBSP; - > ASP.NET - >点击编辑全局配置  - >身份验证 - >检查"enbale the role manager"" - >申请;
$


当我点击"ASP.NET配置"时在解决方案浏览器中。 "无法连接到SqlServer数据库。"蹦出来。并且根据原因可能导致该问题是关于"服务器名称"的。 ,&NBSP;&NBSP; "凭证" ,"没有足够的权限和QUOT;

解决方案
你可以请验证您的SQL安装在混合模式(Windows和SQL身份验证)

Hi, May I consult you gays about the connection about ASP.NET and SQL SERVER 2005. These days i've been working on a web service in ASP.NET. After I inputed all the data and code into the project, I've found that my website couldn't connect to the SQL SERVER DATABASE. Since I've tried all the way from the book , the net and some familiar people who might be good at it, I think you guys can be helpful.
 The situation is like this:
                                     My OS is winxp(x86). The software I'm working on is Visual Studio 2008. I'm working in a Lan Network. I use an account created by the admin of the Lan to log into my computer. The connection url is fine which I test it with a simple winFormApp. I build this connection environment just by the book:
 1, install the .net Framework SDK v2.0;
 2, use SDK_cmd to do aspnet_regsql;
 3, I did the routine job in VS 2008: tool-->option-->DATABASE tools-->DATA connection-->input SQL Server name then, tool--> connect to DATABASE --> input the server name--> choose Windows authentication -->click TEST (the result show is a success).
 4,Open the IIS(my IIS version is 5.1) -->right click default website --> property   --> ASP.NET --> click Edit Global Configuration  -->  general  -->  click connection string manager  -->  choos LocalSqlServe  r-->  change the string on the right with the right url --> apply;
 5,Open the IIS(my IIS version is 5.1) -->right click default website --> property  --> ASP.NET --> click Edit Global Configuration  --> authentication --> check the "enbale the role managerment" --> apply;

And when I click the "ASP.NET Configuration" in solution explorer. "Cannot connect to SqlServer Database." popped out. And according to the reason might cause this problem are about "server name" ,   "credential" , "insufficient privileges"

解决方案

Hi, can you please verify your sql installation is in mix mode (Windows and Sql Authentication).


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

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