c# - SharePoint Custom Web Part throws SELECT permission denied on object 'xxx', database 'yyy', owner 'dbo' -


I created a custom web part in SharePoint 2007 using VS 2008 on dev server. It uses SQL DB everything works fine on my server, which was created by the backup client with Test DB.

Now I'm taking it to the customer's production server. I was able to deploy, install and activate it.

But when I want to add web part to the page, it throws a dialog box "An error occurred while executing the command definition. Internal exceptions for details".

It is that I am looking into LOG file: ... Permission denied on selection object 'xxx', database 'yyy', owner 'dbo' ... < / P>

The web part uses DB using escalated realms, i.e. using the portal app pool service account. This account has the proper authority to reach DB. I do not understand what might be the cause of the problem.

With any help, find out what the cause of the error is!

Edit:

To add the pasted formatting to the code comment, include:

  SPSecurity.RunWithElevatedPrivileges (Rep ({{WAStockBinEntities} Reference = New WAStockBinEntities ()) by using {var userStockBin = (1view_SP_StockBin in the context where stockbins.ADName = = Select CurrUserName Stockben) .OOLIT (). FirstOr Default (); StokerumNumber.txt = Userstock Bin. StuckRoom; Binnumber. Text = Userstock bin.bin;}});  

SPSAquiryRanvith elevated Privilege does not affect user That LINQ uses the database to access I will look at the connection string that LINQ is using to access the database and ensures that the user specified in the connection string is the database permission

< P> You can check the connection string The call is being used by connection.connection string data reference property.

 using  (WAStockBinEntities Reference = New WAStockBinEntities ()) {reference reference.Connection.ConnectionString; }  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -