views:

142

answers:

1

Hi,

I intend to execute a stored procedure using enityspaces and wrote the following method in Custom file.

public BizUnitCollection loadby_bizunitname(string description) {
    BizUnitCollection rtn_Ary = new BizUnitCollection();
    esParameters parameters = new esParameters();
    parameters.Add(new esParameter("name", description));
    rtn_Ary.Load(EntitySpaces.DynamicQuery.esQueryType.StoredProcedure, "formsManager.up_BizUnitTree_SelectLikeName", parameters);
    return rtn_Ary;
}

While executing, it has thrown error as "The stored procedure dbo.formsManager.up_BizUnitTree_SelectLikeName could not be found".

The program is always adding the word 'dbo' to the given stored procedure name. Thats why it does not exist in the database because it belongs to another schema, not dbo schema. Any suggestions please to execute the stored procedure.

dbo, formsManager, smartforms are existing schemas in my database.

Earlier, the same probelm occured while accessing datatables that belong to different schemas. At that time I unchecked the option "Ignore Schema" in enity spaces tool. It worked fine with tables. Iam facing the similar problem with stored procedures.

Would appreciate your help.

Report Post

A: 

Set the schema before the load...

rtn_Ary.es.Connection.Schema = "SchemaName";
George