locked
Could not find stored procedure RRS feed

  • Question

  • My web app cannot find the stored procedures.  The procs are in the db and everything works great at my office, but up in Azure its a no go.

    I have tried addint "dbo." to the proc name when I call it, but I still get the error.

    What else should I look into to solve this?


    Thanks, Terrence

    Edit: After more research, I think this may be an issue of permissions.  How would I assign execute permisions on my sp to the account that I am using in the conn string?  I can't seem to find a way in the portal.

    SqlConnection conn = DataTool.GetConnection(connectionString);
    
    SqlCommand command = new SqlCommand("dbo." + spName, conn);
    command.CommandTimeout = timeoutSeconds;
    command.CommandType = CommandType.StoredProcedure;
    
    if (parameters.Length > 0)
    	foreach (SqlParameter parm in parameters)
    		command.Parameters.Add(parm);
    
    
    CommandBehavior behavior = (_PersistentConnection == null) ? CommandBehavior.CloseConnection : CommandBehavior.Default;
    
    try
    {
    	SqlDataReader dr = command.ExecuteReader(behavior);
    	return (IDataReader)dr;
    }
    catch (Exception e)
    {
    	TESqlException tes = new TESqlException(e.Message, e);
    				
    	foreach (SqlParameter parm in parameters)
    		tes.Parameters.Add(parm);
    	throw tes;
    }



    • Edited by Terrence_ Tuesday, June 26, 2012 11:08 PM
    Tuesday, June 26, 2012 10:34 PM

Answers

  • I had a connection string property set to another database.

    My problem is solved.


    Thanks, Terrence

    • Marked as answer by Terrence_ Wednesday, June 27, 2012 6:55 PM
    Wednesday, June 27, 2012 3:26 PM

All replies