如何使用 Subsonic 3 返回数据集?
我有一些使用 Subsonic 1.x 的旧代码,想要迁移到 3。我的一些旧方法过去常常使用旧的 Subsonic Query 对象返回数据集,然后只调用 ExecuteDataset()。
我仍然需要支持这些方法,因为它们是由其他代码调用的……但是,我在任何地方都找不到如何使用 Subsonic 进行代码查询以返回数据集。还是完全消失了??
有人可以帮忙吗?谢谢你!
I have some old code that was using Subsonic 1.x and want to migrate to 3. Some of my old methods used to return a Dataset using the old Subsonic Query object and then just calling ExecuteDataset().
I still need to support those methods, since they're called by other code...however, I can't find anywhere how to to a code query with Subsonic that will let me return a Dataset. Or is that completely gone??
Can anyone help? Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以返回执行 Reader,然后将数据从 Reader 加载到数据表,如下所示:
You can return execute a Reader and then Load the data from the reader to the datatable, something like this:
我没有在 SubSonic 3.0 中使用过此功能,但
SubSonic.DataProviders.DbDataProvider
对象有一个ExecuteDataSet
方法,该方法采用QueryCommand
对象。这可能就是您所需要的。I have not used this in SubSonic 3.0, but the
SubSonic.DataProviders.DbDataProvider
object has anExecuteDataSet
method that takes aQueryCommand
object. That might be what you need.