我的数据库中有几个存储过程,其中一些有参数,一些没有参数。我尝试通过调用存储过程来填充业务对象,但到目前为止失败了。我怎样才能动态地做到这一点?稍后,我想使用该对象作为报告的数据源......但这就是下一步。重要的事实是:
- 不同的存储过程返回不同数量的列
- 存储过程可以有参数,但它不是必需的
我怎样才能实现这一点?
谢谢 :)
I have several stored procedures in my database, some of them have params, some have no params. I tried to fill a business object by calling the stored procedures, but failed so far. How could I do that dynamically? Later, I want to use this object as a datasource for a report...but thats the next step. The important facts are:
- different stored procs return different amount of columns
- stored procs can have params, but its not required
How could I achieve that?
Thanks :)
发布评论
评论(1)
最好的办法是废弃 MSDN 上那篇文章中的业务对象代码,下载 NHibernate,浏览 入门指南,然后逐步浏览此来自 Ayende 的博客文章。
然后,您从 NHibernate 创建的对象可用于绑定到您在评论中引用的 MSDN 文章上的报表查看器。
祝你好运! :)
Your best bet is to scrap the business object code from that article on MSDN, download NHibernate, go through the Getting Started guide, and then walk through this blog post from Ayende.
The objects you create from NHibernate then can be used to bind to the Report Viewer on the MSDN article you referenced in your comment.
Good luck! :)