The following code results in a 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());
but this does not time out...
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();
I don't understand why, can anyone enlighten me?