0

我已经成功地将我所有的数据库从 2008 年迁移到 2012 年,并将用户映射到特定的数据库。

我的问题是 2008 年已过期(因此我得到了 2012 年)并且我正在使用 Web 服务来调用/编辑表中的数据。

当我运行 Web 服务功能时,它只是超时,这表明它仍在尝试与 2008 通信。

我在用 -

using System.Data.OleDb;
using System.Data.SqlClient;

有连接 -

OleDbConnection objConnection = null;
OleDbCommand objCmd = null;
String strConnection, strSQL;
strConnection = "Provider=sqloledb;Data Source=.;Initial Catalog=NSN;User Id=userID;Password=password;Connect Timeout=300";

我的问题是,既然我已经迁移了所有数据库,如何让 Web 服务指向 SQL Server 2012?

4

2 回答 2

0

尝试将您的连接字符串更改为以下内容:

strConnection = "Provider=sqloledb;Data Source=.\<INSTANCENAME>;Initial Catalog=NSN;User Id=userID;Password=password;Connect Timeout=300";

SQL Server 2012 实例的名称在哪里。它应该与您在管理工作室登录对话框中输入的“服务器名称”相同。

问题是您正在尝试连接到默认实例,即您的 SQL Server 2008 安装。

于 2012-06-15T09:52:12.587 回答
0

If your SQL Server 2008 has expired why dont you then remove the access for the user mentioned in your connection string to the SQL 2008 Db or best make it offline. If the application fails then you know that it was still pointing to SQL2008.

于 2012-06-15T20:28:22.510 回答