开发者

DataAdapter Fill command prohibit "write" operation

Is there any way I can avoid "wri开发者_如何学运维te" operations while a dataset "Fill" operation ?

To my surprise, if I run this commmand text using DataAdapter Fill ->

"Delete from Table"

it succeeds and removes all records which is kind off dangerous for the functionality I am trying to implement(putting sql in config file which will be run dynamically). Is there any way we can prohibit "write" operations when we are running "Fill" command.

Regards Amit


There's no way to do this from a DataAdapter. You could try some prehemptive checking on the string before you pass it into the DataAdapter, but there's a lot of ways to get around that.

If you want to prohibit writes, then you should change the user's permissions on the database instead. You could then do your updates through stored procedures, for example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜