Я пытаюсь получить вывод хранимой процедуры в функцию, но с моим кодом я всегда получаю сообщение об ошибке, указывающее, что выходной параметр не указан......
public int UserAuthentication(String username, String password)
{
SqlConnection conn = new SqlConnection("Data Source=...\\..; Initial Catalog=CUSTOMER360;User ID=sa;password=******");
SqlCommand command = new SqlCommand("sp_Campaign_UserAuthentication", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new SqlParameter("@login_id", SqlDbType.VarChar, 50, "loginid"));
command.Parameters.Add(new SqlParameter("@password",
SqlDbType.VarChar,50,
"password"));
SqlParameter ret = command.Parameters.Add(" @result", SqlDbType.Int);
ret.Direction = ParameterDirection.ReturnValue;
command.Parameters["@login_id"].Value = username;
command.Parameters["@password"].Value = password;
conn.Open();
command.ExecuteNonQuery();
conn.Close();
return (int)ret.Value;
}