[英]C# Program is using my Windows AD authentication to connect to my database instead of the connection string I coded into it. Why?
The title almost says it all, but I'll provide a little background. 标题几乎说明了所有内容,但我将提供一些背景知识。
I am working on adding password hashing to a program written by a team member who rather suddenly departed this world. 我正在为一个突然离开这个世界的团队成员编写的程序添加密码哈希。 I have all of the original source, and have made appropriate changes.
我拥有所有原始来源,并进行了适当的更改。
The issue arises when, after looking at the active connections on the database, the connection it is making is under my Windows Activate Directory username, rather than the connection string I give to SqlConnection(). 当在查看数据库上的活动连接之后,正在建立的连接位于我的Windows Activate Directory用户名下,而不是我提供给SqlConnection()的连接字符串下时,就会出现问题。
I am not traditionally a C# programmer, but the language is very easy to pick up on. 我传统上不是C#程序员,但是使用该语言非常容易。 For those more accustomed to C#'s particular ins and outs, what can I do to assure that I'm connecting through the connection string passed to SqlConnection()?
对于那些更习惯C#的具体内容的人,我该怎么做以确保我通过传递给SqlConnection()的连接字符串进行连接?
This is important since people who are not me and have no authorization to the database are not going to be able to even validate their DB stored usernames + password without using that connection string. 这很重要,因为不属于我并且没有数据库权限的人甚至不使用该连接字符串就无法验证其数据库存储的用户名和密码。
EDIT: My current connection string is as follows: 编辑:我当前的连接字符串如下:
user id=[uid];password=[password];server=[server];Trusted_Connection=yes;database=[dbName];connection timeout=30"
用户id = [uid];密码= [密码];服务器= [服务器]; Trusted_Connection =是;数据库= [dbName];连接超时= 30“
Trusted_Connection
is an alias for Integrated Security
, which means "use my Windows account". Trusted_Connection
是Integrated Security
的别名,表示“使用我的Windows帐户”。 Remove it from your connection string. 从连接字符串中删除它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.