SQL Server连接 [英] SQL Server Connectivity

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

问题描述

大家好,
我刚刚在计算机上安装了SQL Server 2008.我只是为Windows设置了安全性
验证.我将数据库从SQL Server 2000还原到SQL Server 2008
成功.
但是我在前端有我的ASP.NET应用程序.在我的.NET应用程序中的Web.config文件中.

Hello all,
I just installed SQL server 2008 on my machine. I just put security for windows
authentication. I restore the database from SQL server 2000 to SQL server 2008
successfully.
But I am having my ASP.NET application at the front end. In my .NET application in Web.config file.

<appsettings>
  <add key="strConString" value="Initial Catalog=(Name of database);Data Source=(Name of server);User Id=sa" />
  <add key="strConString1" value="Initial Catalog=ArchieveDB;Data Source=(Name of server)server;User Id=sa" />
  <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
 </appsettings>



但是在执行业务逻辑时,它无法执行con.open()命令.

然后,我尝试将服务器身份验证从Windows更改为具有提供的用户名的服务器,但是在更改身份验证时,SQL Server 2008中遇到了一些错误

有人可以帮我吗?



But while executing the business logic it could not able to execute con.open() command.

Then i try to change the server authentication from windows to server with username provided, but it encounter some error in SQL server 2008 while changing the authentication

Can anybody help me.

推荐答案

尝试使用此方法

Try to use this

<add name="strConnection" connectionstring="Data Source=<server IP / Name>;Initial Catalog=<database Name>;Persist Security Info=True;User ID=<Username>;Password=<UserPassword>" providername="System.Data.SqlClient" />


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

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