Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7559677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:41:44+00:00 2026-05-30T12:41:44+00:00

I have a very peculiar problem. In the VS2010 Server Explorer, I can connect

  • 0

I have a very peculiar problem. In the VS2010 Server Explorer, I can connect to a SQL Server and execute a stored procedure just fine. However, when I try to do this in the code I get an exception thrown:

The xp_cmdshell proxy account information cannot be retrieved or is
invalid. Verify that the ‘##xp_cmdshell_proxy_account##’ credential
exists and contains valid information.

Now maybe I used the wrong credentials in the code, but then I copied the connection string from the server explorer and put it into my connection string in my config file. Still, the same error.

Here is the code that does the connecting and calling of the stored procedure:

public static DataSet callStoredProcedure(string procedure, params SqlParameter[] args)
{
    SqlDataAdapter adapter = new SqlDataAdapter();
    DataSet dataSet = new DataSet();

    string connString = ConfigurationManager.ConnectionStrings["App"].ConnectionString;

    try
    {
        using (SqlConnection conn = new SqlConnection(connString))
        using (SqlCommand command = conn.CreateCommand())
        {
            conn.Open();
            if (args != null)
            {
                foreach (SqlParameter param in args) command.Parameters.Add(param);
            }
            command.CommandText = procedure;
            command.CommandType = CommandType.StoredProcedure;

            adapter.SelectCommand = command;
            adapter.Fill(dataSet, "tabela");
        }
    }
    catch (SqlException exception)
    {
        throw new Exception("SqlClient exception", exception);
    }

    return dataSet;
}

And here is the relevant config XML for the connection string, which is copied from the connection string the Server Explorer uses:

  <connectionStrings>
    <add name="App" connectionString="Data Source=db2.myapp.com,49178\hosting;Initial Catalog=app;User ID=appuser;Password=f00barbaz" providerName="System.Data.SqlClient" />
  </connectionStrings>

Again, the Server Explorer can connect to the server and execute the stored procedure, but my code constantly throws the same Exception. What could be causing this?

Thank you

EDIT
To make it clear: the Server Explorer can both connect and execute stored procedures with the same connection string that my code uses. Yet my code throws an exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:41:45+00:00Added an answer on May 30, 2026 at 12:41 pm

    Does your sproc call xp_cmdshell?

    If so, see:

    http://msdn.microsoft.com/en-us/library/ms175046.aspx

    When it is called by a user that is not a member of the sysadmin fixed
    server role, xp_cmdshell connects to Windows by using the account name
    and password stored in the credential named
    xp_cmdshell_proxy_account. If this proxy credential does not exist, xp_cmdshell will fail.

    The proxy account credential can be created by executing
    sp_xp_cmdshell_proxy_account. As arguments, this stored procedure
    takes a Windows user name and password. For example, the following
    command creates a proxy credential for Windows domain user
    SHIPPING\KobeR that has the Windows password sdfh%dkc93vcMt0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have very strange problem, one of our applications is continually querying server by
We are running MS SQL 2005 and we have been experiencing a very peculiar
I am dealing with a very peculiar problem at the moment: I have an
I have a very peculiar problem:(not using web.config) DefaultFacebookApplication dfa=new DefaultFacebookApplication(); dfa.AppId = ...;
I have a very peculiar problem. I understand that while in the foreground the
I have a very peculiar problem across the IE board (ignoring IE6). Basically I
I have a very peculiar problem and my last resort was asking this on
i have very simple problem. I need to create model, that represent element of
I have come across what appears to be very peculiar behaviour using entity framework
I have very general problem on DNN 6.0 web site that I am working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.