Hi
This piece of code once called, it will populate a gridview and return the # of records correctly, however, when I use an output argument in the method, the calling
protected void Person_SelectByCountry()
{ // with implicit parameters No Identity or record affected
// this does not have output parameter returned back via the method
// since this is select, we do not use RETURN instead we use output para to get Rec Affected
using (SqlConnection connection = new SqlConnection(strConStr))
{
SqlCommand cmd = new SqlCommand("Person_SelectByCountry", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Country", txtCountry.Text);
cmd.Parameters.Add("@RecAffected", SqlDbType.Int).Direction = ParameterDirection.Output;
connection.Open();
SqlDataReader dr = cmd.ExecuteReader();
gvPerson.DataSource = dr;
gvPerson.DataBind();
...
Go to the complete details ...