简体   繁体   English

在VB.net中的SSPI连接字符串中使用特定用户

[英]Use specific user in SSPI connection String in VB.net

I am making a windows form application(desktop application) that connects to database. 我正在制作一个连接到数据库的Windows窗体应用程序(桌面应用程序)。 I also created a service account domain\\user. 我还创建了一个服务帐户域\\用户。 Now, i deploy my application using clickonce and use IIS to launch my application. 现在,我使用clickonce部署我的应用程序,并使用IIS启动我的应用程序。 In IIS, I set my application pool identity to the service account I created so that my application will connect to database using that service account since that was the only account with access to my database. 在IIS中,我将应用程序池标识设置为我创建的服务帐户,以便我的应用程序将使用该服务帐户连接到数据库,因为该帐户是唯一有权访问我的数据库的帐户。 When I test my application, it failed to connect to my database. 当我测试我的应用程序时,它无法连接到我的数据库。 It says that user has no connection to database. 它说用户没有与数据库的连接。 Upon checking the error, it shows that it used the account of the currently logon user in the pc where my application is launch instead of the account I set in IIS. 检查错误后,它表明它使用了启动应用程序的PC中当前登录用户的帐户,而不是我在IIS中设置的帐户。 By the way, I am using SSPI connection string, and my SQL is set to windows authentication. 顺便说一句,我正在使用SSPI连接字符串,并且我的SQL设置为Windows身份验证。 Is it possible for my application to use the account set in IIS to connect to my database? 我的应用程序是否可以使用IIS中设置的帐户连接到我的数据库? If no, is there a way for me to use the service account I created to connect to my database? 如果不是,是否可以使用创建的服务帐户连接到数据库? Please help, 请帮忙,

在此处输入图片说明

here, when i click browse in IIS manager, this will load and when I click lauch, my windows form will load. 在这里,当我单击IIS管理器中的“浏览”时,这将加载,而当我单击“浏览”时,将加载我的Windows窗体。

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

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