ASP.NET webforms cannot exec stored procs

Discussion in 'ASP .Net' started by Paul R, Dec 2, 2003.

  1. Paul R

    Paul R Guest

    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
     
    Paul R, Dec 2, 2003
    #1
    1. Advertising

  2. Paul R

    Eric Veltman Guest

    Paul R wrote:

    > 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.
     
    Eric Veltman, Dec 2, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QUtKVFI=?=

    Multiple stored procs for dataadapter

    =?Utf-8?B?QUtKVFI=?=, Dec 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    Karl Seguin
    Dec 21, 2004
  2. Roy
    Replies:
    4
    Views:
    486
    souri challa
    Jun 2, 2005
  3. JV

    Calling Oracle Stored Procs

    JV, Nov 21, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    900
    =?Utf-8?B?VmVua2F0X0tM?=
    Nov 23, 2005
  4. =?Utf-8?B?bWltbw==?=
    Replies:
    0
    Views:
    497
    =?Utf-8?B?bWltbw==?=
    Jan 5, 2006
  5. matt
    Replies:
    1
    Views:
    296
    George Ogata
    Aug 6, 2004
Loading...

Share This Page