ASP.NET webforms cannot exec stored procs

P

Paul R

Hi,

I have a Winforms application that access some SQLServer2000 stored
procedures.

I have now written some new Webforms pages to use some of the same stored
procs. The Webforms use the SAME data access classes (all of my business
logic and data access classes are in DLLs that are shared between the
Winforms and Webforms).

The Winforms are all ok, but the Webforms give me the following error when I
try to access the database through stored procs:

Execute access is denied to stored procedure "GetParts" in database
"Lcc" for owner "dbo"

The WinForms and WebForms all use the same db connection string:
<add key="connection_string" value="Server=(local);Database=lcc;Integrated
Security=True"/>

I guess it is an access rights problem, but what is the best way to resolve
it?

Do the Webforms connect as a different user?

Thanks,

Paul
 
E

Eric Veltman

Paul said:
Execute access is denied to stored procedure "GetParts" in database
"Lcc" for owner "dbo"

The WinForms and WebForms all use the same db connection string:
<add key="connection_string" value="Server=(local);Database=lcc;Integrated
Security=True"/>

I guess it is an access rights problem, but what is the best way to
resolve it?

Do the Webforms connect as a different user?

Though it depends on the setup of the web server and ASP.NET, the ASP.NET
code usually runs under a dedicated ASP.NET user. So you can either give
that user access to the stored procedures or you can change the setup of
the web server and ASP.NET, so that the ASP.NET code impersonates the
user who is sitting behind the web browser. Disable Anonymous access for the
folder/page in IIS and enable impersonation in web.config to do so.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top