简体   繁体   English

C# 可以用windows登录连接sqlserver数据库吗?

[英]C# can we use windows login to connect sqlserver database?

Recently i have developped a local backend accessing some data on SQLserver for webdevelopment.最近我开发了一个本地后端,可以访问 SQLserver 上的一些数据以进行 Web 开发。 So i use the connection string with the parameter "integrated security true".所以我使用带有参数“集成安全真”的连接字符串。 It works fine until i put my backend in server, the server doesnt recognize the username.在我将后端放入服务器之前它工作正常,服务器无法识别用户名。 I checked the errors.我检查了错误。 My Backend use the server windows login.我的后端使用服务器 windows 登录。 My question: does it exist a way to use the client windows login to connect the database and not the server login?我的问题:是否存在使用客户端 windows 登录连接数据库而不是服务器登录的方法? (for example change the connection string?) Kind Regards. (例如更改连接字符串?)亲切的问候。 Thanks in advance.提前致谢。 PS: Sorry for my bad english. PS:对不起我的英语不好。

We can use windows account to connect to SQL server, suggest you share us the error message that you got when your connection failed.我们可以使用 windows 帐号连接到 SQL 服务器,建议您将连接失败时收到的错误信息分享给我们。 It will help us to analysis the issue.它将帮助我们分析问题。 Or you can get the SQL server error message from error log.或者您可以从错误日志中获取 SQL 服务器错误消息。 Refer to Viewing the SQL Server Error Log .请参阅查看 SQL 服务器错误日志

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM