Problem reading out parameter from stored procedure using c#
问题 I just come across a strange problem where i cannot retrieve the sql stored procedure out parameter value. I struck with this problem for nearly 2 hours. Code is very simple using (var con = new SqlConnection(connectionString)) { con.Open(); SqlCommand cmd = new SqlCommand("sp_mgsearach", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter param1 = new SqlParameter("@SearchTerm", SqlDbType.VarChar); param1.Value = searchTerm; param1.Direction = ParameterDirection.Input; cmd