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

anjartaz
 
on Feb 01, 2018 01:08 AM
2943 Views

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

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Feb 01, 2018 03:05 AM
on Feb 01, 2018 03:07 AM

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.

pvermacs
 
on Feb 02, 2018 04:24 AM

Please check  the database if it contains the stored procedure

sp_helptext [procedurename]

if  it  returns defination  that means it is in database.