存储过程执行问题

时间:2009-12-02 04:04:11

标签: stored-procedures entityspaces

我在C#应用程序中实现实体空间,并且能够成功执行下面的查询。

coll.query.where(coll.prodlineid.equal( “ID”) if(coll.query.load())

但是我需要使用存储过程替换代码中的所有这些查询。为此,我用了:coll.Load(esQuerytype.storedprocedure,“testproc”,param)

此时,Iam因为其保护级别而无法访问“EntitySpaces.Core.esEntityCollection.Load(EntitySpaces.DynamicQuery.esQueryType,string,params object [])”时出现错误

esEntityCollection是一个元数据文件,因此我无法将访问修饰符从受保护更改为公共。

帮助: - )

1 个答案:

答案 0 :(得分:1)

在自定义部分类(已生成)中,添加如下方法。

public void GetProducts(int LineID)
{
   this.Load( ...<put your stored proc call here>...);
}

然后你可以通过以下方式调用你的存储过程。

ProductCollection coll = new ProductCollection();
coll.GetProducts(lineID);