从Windows登录迁移到SQL Server登录 [英] Move from Windows login to SQL Server login

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

问题描述

我的winform应用程序与SQL Server(2008)连接。它目前仅使用Windows身份验证,但我也被赋予了允许SQL Server登录的任务。



我不知道如何测试我的代码是否真的使用SQL Server登录而不是Windows登录。



我能在这做些什么吗?

My winform app connects with SQL Server (2008). It uses only Windows authentication at the moment, but I was given a task to allow SQL Server logins also.

I am not sure how to test if my code really uses SQL Server login and not Windows login.

Is there something I can do here?

推荐答案

你要做的就是改变连接字符串:remove
All you have to do is change the connection string: remove
Integrated Security=true

并添加SQL用户名和密码:

and add the SQL username and password instead:

Server=ServerAddress;Database=DataBaseName;User Id=MyUserName;
Password=MyPassword;





请看这里: http://www.connectionstrings.com/sql-server-2008/ [ ^ ]


即使你的问题太宽泛,我想这可能有所帮助:



您需要创建一个具有所有必要权限的新SQL Server登录。然后,您需要更新应用程序的连接字符串(在更新之前将它们合并到一个配置文件中)。



之后,您应该在应用程序中添加一个登录表单(供用户输入凭据),该表单将在应用启动时显示。



要进行测试,只需在SQL Server中禁用Windows用户并检查应用程序是否仍在运行。



希望我帮助过。
Even though your question is too much broad, I guess this can help:

You’ll need to create a new SQL Server login with all necessary permissions. Then, you’ll need to update your app’s connection strings (do consolidate them in one config file before updating).

After that, you should add a login form to your application (for a user to enter credentials), which will be shown at the app startup.

To conduct your testing, just disable your windows user in SQL Server and check to see if the app is still running.

Hope I helped.


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

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