如何使用对象上下文接收存储过程的结果?
我有一个存储过程,并且正在 VS10 实体框架中工作。我想从我的 DAO 调用该存储过程,但不知道如何接收结果。有人请提供想法吗?
ConsentReleaseResult consentReleaseResult = new ConsentReleaseResult();
try
{
using (PC2Entities objectContext = new PC2Entities())
{
var consent = objectContext.spGetConsentRelease(id);
}
}
/* Handling Error Logging */
catch (Exception exception)
{
}
我想在“consentReleaseResult 对象”中收到我的结果。 var 同意 = objectContext.spGetConsentRelease(id);抛出异常。请指导我!
I have a stored procedure and I am working in VS10 entity framework. I want to call that stored procedure from my DAO but don't know how to receive the results. Anybody give idea please?
ConsentReleaseResult consentReleaseResult = new ConsentReleaseResult();
try
{
using (PC2Entities objectContext = new PC2Entities())
{
var consent = objectContext.spGetConsentRelease(id);
}
}
/* Handling Error Logging */
catch (Exception exception)
{
}
I want to receive my result in "consentReleaseResult object".
var consent = objectContext.spGetConsentRelease(id); throws an exception. Please guide me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过以下语法获取结果
如果您的存储过程返回完整的表值,那么您可以获得如下记录
You can get the results from following syntax
If your store procedure returns full table value then you can get the records as