我嘗試備份我的數據庫,但我得到一個錯誤:備份大尺寸數據庫超時錯誤在SQL Server
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The backup or restore was aborted.
這是我的代碼,我的數據庫是高達20GB的大小。
string query = "Backup database Testing to disk='C:\Test.bak'"
con.Open();
cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
con.Close();
如何更改C#或查詢中的超時值?
肯定是一個快速谷歌搜索會顯示什麼? –
RTFM。我的意思是,嚴格來說,SqlCommand有一個屬性。它如此隱藏,甚至被命名爲「CommandTimeout」。 – TomTom