Should I use ExecuteNonQuery for this db backup command

后端 未结 8 876
迷失自我
迷失自我 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:15

    I think ExecuteNonQuery is fine, but You should consider to user a timeout with Your query.

    objCommand.CommandTimeout = 60*60; // for an hour or more

    If You're using a desktop application, then for sure You should execute this query within asynchronous call.

提交回复
热议问题