简体   繁体   English

C#程序使用我的Windows AD身份验证而不是我编码到其中的连接字符串连接到我的数据库。 为什么?

[英]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_ConnectionIntegrated Security的别名,表示“使用我的Windows帐户”。 Remove it from your connection string. 从连接字符串中删除它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么到SQL Server的c#连接字符串不能与Windows身份验证一起使用? - Why won't my c# connection string to a SQL server work with Windows authentication? C#Windows应用程序:使用Windows身份验证连接到远程SQL Server 2008的连接字符串 - C# Windows application: connection string to connect to remote sql server 2008 using windows authentication 如何使用 c# 连接到我的 MySql 数据库? - How can i connect to my MySql database using c#? 我无法将我的数据库与我的 c# windows 表单应用程序连接,我收到“未处理的异常”错误 - i cant connect my database with my c# windows form app i get "unhandled exception" error 是否有一个通用连接字符串,用于使用我的vs2010开发的程序连接到本地数据库的不同计算机 - Is there a universal connection string for different computers to connect to a local database using my program developed by vs2010 如何在具有(或不具有)Windows身份验证模式的情况下使用本地SQL Server数据库设置C#Winforms应用程序? - How to setup my C# Winforms app using local SQL Server database with (or without) Windows authentication mode? 我无法使用连接字符串连接数据库 - I am unable to connect my database in the connection string 如何在我的开发环境中从Windows 7 x64上的C#连接到Oracle数据库 - How can I connect to an Oracle Database from C# on Windows 7 x64 in my development environment SQL Server连接C#:到数据库的身份验证Windows使用计算机名代替 - SQL Server connection C# : Authentication Windows to database uses computer name instead 为什么我无法将Oracle数据库与C#Windows应用程序连接? - Why i can not to connect oracle database with c# windows application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM