how to set user to ASPNET back for db connections??

D

dee

Hi,
This might be a very simple one but I havn't been able to get it
working.
I have Impersonate to be ON in web.config file.
I have sections of application that impersonate as someone other and
accesses parts of codes. When I provide a database user name and
password and access the database it is fine.

I have some sections in the application that I would like ASPNET
access to work with. Right now, if I do not fill username and
password, it tries to use currently logged in user's credential to
access the database. How do I get it to use ASPNET credential?
Thanks in Advance
dee
 
M

Mohamoss

Hi dee
let me rephrase what i think the problem is . you were able to
impersonate the user that access your application . in some part of the app
, you ask for a user name and password and use these to access a db . what
you want to do it to use the ASPNET user account to access the database if
you don't have to the use name and password from the user .
One way to do that is to construct a connection string that use ASPNET
as the user name , use this string to open the connection to the database .
one other thing that might help is , if you ask for impersonation
somewhere in your code . if you leave the allow attribute of the web.config
to allow="*" , then impersonation will not take place ( even if you have it
on ) and you can change that later if you would like to impersonate .
hope that would help

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top