DataAdapter Fill command prohibit "write" operation

380 Views Asked by At

Is there any way I can avoid "write" 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

1

There are 1 best solutions below

0
On BEST ANSWER

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.