using (SqlConnection Connect = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["templateconnection"].ConnectionString))
{
string strQuery = "update ActionAudits set ChecksumValue=( select CHECKSUM(Id,DateAndTimeOfAction,ActionType,RecordType,ReferenceNumber,UserFk,LocationFk,PatientFk,IPAddress) from ActionAudits with(nolock) Where Id=" + id + ")where Id=" + id;
SqlCommand cmdChecksumValue = new SqlCommand(strQuery, Connect);
Connect.Open();
value = Convert.ToInt32(cmdChecksumValue.ExecuteNonQuery());
Connect.Close();
}
执行Convert.ToInt32(cmdChecksumValue.ExecuteNonQuery())
时
它显示
错误:连接超时错误
答案 0 :(得分:0)
将cmdChecksumValue .CommandTimeout设置为更大的数字。默认值为30秒。