从Windows登录迁移到SQL Server登录

编程入门 行业动态 更新时间:2024-10-26 00:26:20
本文介绍了从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;

请看这里: www.connectionstrings/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登录

本文发布于:2023-10-16 10:18:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1497289.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Windows   SQL   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!