Windows模拟后的数据库查询检索 [英] Database query retrieval after windows impersonation

查看:61
本文介绍了Windows模拟后的数据库查询检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个例程,该例程允许其他人在其他工作站上登录该应用程序,目的是允许用户根据公司业务规则完成任务或接受培训.模拟完成后,它将从数据库中检索用户信息,这是我的错误消息所在的地方

我已经在同一台计算机上使用3个不同的用户ID测试了登录/模拟,并得到3个不同的错误.我经过测试的所有人都具有正确的数据库访问权限/特权

1.以我的身份登录可以正常工作,如果我使用其他3个不同的帐户登录,它也可以正常运行.

2.登录为我的老板PeterD,然后我从LinQ到SQL语句得到

I have a routine that allows someone else to log-on to the application at a different workstation for the purpose of allowing the user to complete a task according to the company business rules or recieve training. On the impersonation is complete it retrieves user information from the database and this is where my error message is

I have tested the log-on / impersonation with 3 different user id''s on the same machine and get 3 different errors. All of the people that I have tested with all have the correct database access / privileges

1. Logon as me it works as expected and if I logon with another 3 different accounts it works.

2. Logon as my boss PeterD and I get

Specified cast is not valid.



from my LinQ to SQL statement

''Users is a function that returns the LINQ to SQL table
''LogonName is a variable that hold the username i.e. SimonW / PeterD / DuncanB
Dim q = (From U As Tables.Users In Users() Where U.LogonName = logonName Select U).ToList



3.以同事身份登录,出现以下错误



3. Logon as a colleague and I get the following error

Could not load file or assembly ''Oak.DataLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'' or one of its dependencies. Access is denied.



有些博客建议我授予
的权限 C:\Documents and Settings\SimonW\Local Settings\Apps\2.0
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

但是他们没有成功.

更新

这个问题只剩下一个问题,那就是为什么一个用户名会导致它也找不到应用程序也引用过的dll?

我通过创建一个新的LINQ to SQL表类解决了第二个问题.

谢谢
Simon



Some blogs have sugessted that I give permissions to the
C:\Documents and Settings\SimonW\Local Settings\Apps\2.0
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

but they haven''t been successful.

UPDATE

I have only one problem left in this question, that IS why would one username cause it not to find a dll that the application has reference too?

I solved number 2 by creating a fresh LINQ to SQL table class.

Thanks
Simon

推荐答案

解决了最后一个问题,它是我的本地计算机上的权限问题.我必须向用户授予对项目文件夹的读/写权限.
Solved the last problem it was a permissions issue on my local machine. I had to give permissions to the user(s) for read / write permissions on the project folder.


这篇关于Windows模拟后的数据库查询检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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