문제

I know this is not a hell of an useful question but I can't help being bugged by it.

So,
Why said method (in *Command classes) is called
ExecuteNonQuery instead of ExecuteQuery?

Aren't those SQL statements we throw at DBs, queries?

도움이 되었습니까?

해결책

Semantically, a query is something you execute to return data. You're 'querying' the database to find all the X in the Y.

If you're not expecting back results, it's not so much a query as it is a statement or command.

다른 팁

Not if they are INSERTs, DELETEs, CREATE TABLEs, etc.

I would think of it as a query is asking the database for records back. Actions that alter the data/database would not be a query.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top