下面的代码产生一个System.Data.SqlClient.SqlException: Timeout expired
.
const string sqlStmt = @"SELECT *
FROM CUSTOMER_INFO
WHERE CUSTOMER_NO = @CUSTOMER_NO;";
SqlCommand command = new SqlCommand(sqlStmt, connection);
command.Parameters.AddWithValue("@CUSTOMER_NO", txtAccountNo.Text.Trim().ToUpper());
但这不会超时...
const string sqlStmt = @"SELECT *
FROM CUSTOMER_INFO
WHERE CUSTOMER_NO = @CUSTOMER_NO;";
SqlCommand command = new SqlCommand(sqlStmt, connection);
command.Parameters.Add("@CUSTOMER_NO", SqlDbType.VarChar, 25).Value = txtAccountNo.Text.Trim().ToUpper();
不明白为什么,有大神能指教一下吗?