为 OleDbDataAdapter 编写自定义插入/更新命令
我正在使用 OleDbDataAdapter 填充数据集中的表。 问题是 select sql 语句非常复杂(使用左连接从大量表中获取数据)并且 OleDbCommandBuilder 无法为我编写插入/更新语句。
我想知道这里最好的做法是什么? 数据可以更改的列并不多(大约需要 30 列中的 6-8 列),但重要的是我可以尽可能简单地执行 OleDbDataAdapter.Update(速度和资源使用非常重要)。
有人有这样做的经验吗? 这里最好/推荐的行动方案是什么?
谢谢您的意见!
编辑:我还可以使用一些帮助来编写 OleDbDataAdapter 的更新语句,特别是当它涉及多表更新时。 如果有人能给我指点一些文献,那就太好了!
I am using OleDbDataAdapter to fill a table in the DataSet. The problem is that select sql statement is very complex (using left joins to get data from numerous tables) and OleDbCommandBuilder can't write an insert/update statement for me.
I was wondering what is the best course of action here? There aren't that many columns in which data could change (only 6-8 out of 30 or so needed) however it is important that I can do the OleDbDataAdapter.Update as simply as possible (speed and resource usage is very important).
Does anyone have any experience doing this? What is the best/recommended course of action here?
Thank you for your input!
EDIT: I could also use some help with writing update statements for OleDbDataAdapter, especialy when it involves multi-table update's. If anyone can point me to some literature, that would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,我建议您手动编写 SQL 代码。
I recommend that you hand-code the SQL in this case.