我的代码在下面的 ExecuteNonQuery 行中超时。我不知道为什么。我已将超时时间增加到 900,但它仍然超时。
using (var conn = new SqlConnection(localConnection))
{
var command = String.Format(@"UPDATE dbo.Documents SET DocFile = {0} WHERE ID = '{1}'", @"BulkColumn from Openrowset(Bulk 'C:\Work\Document.docx', Single_Blob) AS DocFile", projID);
using (var sqlWrite = new SqlCommand(command, conn))
{
conn.Open();
sqlWrite.Parameters.Add("@File", SqlDbType.VarBinary, file.Length).Value = file;
sqlWrite.ExecuteNonQuery();
}
}