SqlCommandBuilder使用的视图表名而不是 [英] SqlCommandBuilder using table name instead of view

查看:145
本文介绍了SqlCommandBuilder使用的视图表名而不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是SqlCommandBuilder对象生成从一个SqlDataAdapter选择语句UPDATE语句。

I am using a SqlCommandBuilder object to generate update statements from Select statements in a SqlDataAdapter.

我的问题是,在我的Select语句,我从视图称为vwUsers选择。 SqlCommandBuilder对象我用生成的表用户不认为vwUsers一个更新语句。我怎么能覆盖该行为?

My problem is that in my Select statement I am selecting from a view called vwUsers. the SqlCommandBuilder object I used generated an update statement for the table Users not the view vwUsers. How can I override that behavior ?

(我需要使用的视图,因为这是正在执行的触发器。我们添加触发器表视图,而不是原来的表)

(I need it to use the view because this is where the triggers are being executed. We added triggers to the table view instead of the original table)

推荐答案

我解决了丢弃命令生成器和编写SQL更新命令我自己我的问题!

I solved my problem by dropping the command builder and writing the SQL update command myself !

这篇关于SqlCommandBuilder使用的视图表名而不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆