嗨朋友..(非常紧急..) [英] Hi Friends..(Very urgent..)

查看:62
本文介绍了嗨朋友..(非常紧急..)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到运行时异常消息"登录失败。登录来自不受信任的域,不能与Windows身份验证一起使用。"在asp.net中使用远程数据库时。但是我使用相同的远程数据库执行了c#ADO应用程序。
Plzz ..帮我完成了ploblem

解决方案

您好


如果我正确理解您的问题 - 您正在使用Windows身份验证连接到远程数据库,并且您收到错误。


问题是 - 让我们假设ASP.NET应用程序在Web服务器"A"中运行。它试图连接的数据库在机器"B"中。因此当asp.net代码连接到机器"B"中的数据库时使用Windows身份验证选项,飞行的身份是机器A的身份而不是机器B.因此当SQL服务器尝试解析B上的身份时,身份不在B上的sql server的登录列表中。


您有两个选项


- 如果A和B在同一个域上,则登录到Machine B SQL服务器并在登录时添加计算机A身份并提供访问所需的数据库。


- 在SQL Server中创建SQL用户标识和密码。而不是Windows身份验证使用SQL用户标识和密码。在ASP.NET中,您可以加密web.config中的连接字符串,以便密码不可见。

PS:如果这篇文章有用,请投票或将其标记为答案。


I am getting runtime exception  message as "Login failed.Login is from an untrusted domain and cannot be used with windows authentication." while working with remote database in asp.net.But I executed the c# ADO applications with the same remote database.
Plzz..help me to ovecome the ploblem

解决方案

Hi

If i understand your question correctly - You are connecting to an remote database using windows authentication and you are getting the error.

The problem is - Lets assume ASP.NET app is running in web server "A". The database it is trying to connect is in machine "B". So when the asp.net code connects to database in machine "B" with windows authentication option, the identity that gets flown is that of machine A and not machine B. So when the SQL server tries to resolve the identity on B, the identity is not on the Login lists of sql server on B.

You have two options

- if A and B are on the same domain, then login to Machine B SQL server and add machine A identity under logins and provide access to the desired database.

- Create a SQL user id and password in the SQL Server. instead of windows authentication use SQL user id and password. In ASP.NET you can encryot the connection string in the web.config so that the password is not visible.

PS : if this post was helpful, please vote or mark this as answer.


这篇关于嗨朋友..(非常紧急..)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆