Whenever this function is excuted it always return -1. Even the row is affected. why?
public static String TransactionQuery(String SpName, List<SqlParameter> parameters)
{
using (SqlConnection con = new SqlConnection(_conString))
{
using (SqlCommand cmd = new SqlCommand(SpName))
{
cmd.Parameters.AddRange(parameters.ToArray());
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
con.Open();
if (cmd.ExecuteNonQuery() > 0)
{
con.Close();
return "SUCCESS";
}
else
{
con.Close();
return "FAIL";
}
}
}
}