以编程方式恢复数据库 (SQL Server)

发布于 2024-10-02 21:42:39 字数 411 浏览 0 评论 0 原文

我最近发现这个链接,它显示了一个很好的备份示例并恢复 SQL Server 数据库。但是,我的 SQL Server 仅使用 WindowsAuthentication,因此它实际上不需要用户名和密码。为了能够做到这一点,我将行 srvConn.LoginSecure = false; 转换为 srvConn.LoginSecure = true;

我期望成功连接到服务器。但是,此示例返回一个异常,表示无法连接到服务器。

有人可以帮我吗?我必须学习这个应用程序才能将相同的概念应用到我正在从事的项目中。非常感谢。

I recently found this link which shows a great example of backing up and restoring a sql server database. However, my SQL Server only uses WindowsAuthentication and so it does not really require a UserName and Password. To be able to do this, I turned the line srvConn.LoginSecure = false; into srvConn.LoginSecure = true;

I was expecting to connect succesfully to the Server. However, this example returns an exception saying that it was unable to connect to the server.

Can anybody help me please? I have to learn this application for me to be able to apply the same concept to a project i'm working on. Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别挽留 2024-10-09 21:42:39

首先,如果您想启用到服务器的远程连接(我不确定这是否是您想要的),请尝试以下操作: http://support.microsoft.com/kb/914277 。您还需要确保启用混合身份验证选项。

First of all if you want to enable remote connection to your server (I'm not sure if this is what you're after), Try this: http://support.microsoft.com/kb/914277 . You will also want to make sure the mixed authentication option is enabled.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文