简体   繁体   中英

ASP.Net membership + sql server 2008

Update:

Forgot to mention that the app only breaks and shows that error when I try to login as asp.net membership user (sql membership provider), before that everything is fine and the app communicates with the sql just fine.

I'm writing an asp.net app that's using asp.net sqlmembership and connecting to a SQL Server 2008 database remotely via VPN,

Connection string:

add name="MonoSqlServer" connectionString="Data Source=MONO;  
Initial Catalog=SMSPortal;Integrated Security=SSPI;"

This works perfectly if I use the inbuilt http server that comes with visual studio, but if I deploy this to my local IIS (same machine as the inbuilt server) I get an exception:

Exception Details: System.Data.SqlClient.SqlException: Login failed.   
The login is from an untrusted domain and cannot be used with Windows authentication.

What am I doing wrong?

授予NetworkServices(或用于IIS的任何帐户)访问成员数据库的权限

Your ASPNET user doesn't have permission to access the VPN. When you're running in debug under Cassini server, you're accessing the VPN via your own user. You need to either provide the local ASPNET user with permission to the SQL server and VPN or configure your application to use a user account that has access to both.

Apparently your SQL server is in an AD domain that doesn't have trusts established with the domain that your web server and it's aspnet user is in.

Try using sql server auth, ie username and password. I think you will have success.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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