I am a beginner in Sharepoint.
I have a stored procedured which needs to be executed when the user clicks on a button on the sharepoint page.
The Click event is firing as expected but I get an error saying "NT Authority\Anonymous Login` does not have the required permission.
Below is the code for calling the SP
SPSecurity.RunWithElevatedPrivileges(() =>
{
//Impersonate using Windows token
using (WindowsImpersonationContext ctx = SPSecurityContext.GetWindowsIdentity().Impersonate())
{
_connectionString = @"Data Source=MyServer\USERDATA;initial catalog=MyDBName;integrated security=True";
ExecuteSP();
}
});
I know 100% for sure that the ctx does get the Contenxt of the user who has logged in my application but somehow it fails while connecting to the DataBase.
This code runs perfectly on my Dev environment but fails on the testing system.
Any help/ideas?

0 commentaires:
Enregistrer un commentaire