using (SqlConnection connection1 = new SqlConnection(StringCon))
{
string sSQL = string.Format("UPDATE Guest SET FirstName=@Content WHERE GuestID=@GuestID");
SqlCommand MyCmd = new SqlCommand(sSQL, connection1);
SqlParameter param = MyCmd.Parameters.Add("@Content", SqlDbType.NVarChar);
param.Value = "Tony";
SqlParameter param1 = MyCmd.Parameters.Add("@GuestID", SqlDbType.NVarChar);
param1.Value = GuestID;
connection1.Open();
iResult = MyCmd.ExecuteNonQuery();
connection1.Close();
}
But this code cannot execute because this error
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.
Why have error and how to fix it.