且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将sql Server标准版数据库迁移到SQL Express

更新时间:2022-11-24 17:21:23

首先通过Visual Studio连接:

尝试使用Server Explorer窗格在VS中设置连接:

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

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

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

4 )当连接工作时,按确定

5)在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。



您的连接字符串可能特定于旧SQL实例,您需要更改它以使用新的。如果没有这样做,请告诉我们您到底发生了什么错误,以及您正在连接的具体方式 - 包括您使用它时的代码。
Start by connecting via Visual Studio:
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.

The chances are that your connection string is specific to the "old" SQL instance, and you need to change it to work with the new. If that doesn't do it, tell us exactly what error you get, and exactly how you are connecting - including code if you are using it.