Should I use ExecuteNonQuery for this db backup command

后端 未结 8 871
迷失自我
迷失自我 2021-01-17 03:26

I have a method that allows me to kick off a back up of a data base. What I am wondering is if I should be using ExecuteNonQuery() in this context or if there is something

8条回答
  •  有刺的猬
    2021-01-17 04:27

    ExecuteNonQuery is the correct command to use.

    If you wish to receive more info about the restore process you should subscribe to the InfoMessage event of the SqlConnection object. That was you can capture all the "non-error" messages as well.

提交回复
热议问题