ASP.Net Error: Could not find stored procedure up_DinamicQuery using C#

Last Reply 11 months ago By pvermacs

Posted 11 months ago

error code in this source Could not find stored procedure up_DinamicQuery

public int ExecuteNonQuery(string ExecCommand)
{
    int iReturn = -1;
    try
    {
        DbCommandWrapper = GetRetrieveCommand();
        string sqlQuery = Db.GetParameterValue(DbCommandWrapper, "@sqlQuery").ToString();
        Db.SetParameterValue(DbCommandWrapper, "@sqlQuery", ExecCommand);
 
        Db.ExecuteNonQuery(DbCommandWrapper);
        return (int)DbCommandWrapper.UpdatedRowSource;
    }
    catch (Exception ex)
    {
        bool rethrow = ExceptionPolicy.HandleException(ex, "Facade Policy");
        if (rethrow)
        {
            throw;
        }
    }
    finally
    {
        if (DbCommandWrapper is System.Data.SqlClient.SqlCommand)
        {
            DbCommandWrapper.CommandTimeout = 30;
        }
 
    }
    return iReturn;
}

i using sql, same eror if i cant use password and user name

Posted 11 months ago Modified on 11 months ago

Hi anjartaz,

The error suggested that the stored procedure up_DinamicQuery you are trying to access is not present in the Database you are connected. So make sure that the procedure is present in the Database if not present execute the procedure.

Also it is possible that your procedure is in schema other than dbo. Reverify this also.


Posted 11 months ago

Please check  the database if it contains the stored procedure

sp_helptext [procedurename]

if  it  returns defination  that means it is in database.