G
Guest
Maybe someone can see what I am missing. I have a class making a call to a
stored procedure:
cmd.CommandText = "spSubjectCodesUpdate";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@subjectcode", SqlDbType.VarChar, 4, subjectCode);
cmd.Parameters["@subjectcode"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@subjectcode_desc", SqlDbType.VarChar, 60,
subjectCode_desc);
cmd.Parameters["@subjectcode_desc"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@active", SqlDbType.VarChar, 1,active);
cmd.Parameters["@active"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@retval", SqlDbType.VarChar, 250,null);
cmd.Parameters["@retval"].Direction = ParameterDirection.InputOutput;
conn.Open();
string result = Convert.ToString(cmd.ExecuteScalar());
When I run this, I get an unhandled exception:
Procedure or Function 'spSubjectCodesUpdate' expects parameter
'@subjectcode', which was not supplied.
The profiler only says this:
declare @p4 varchar(250)
set @p4=default
exec spSubjectCodesUpdate
@subjectcode=default,@subjectcode_desc=default,@active=default,@retval=@p4
output
select @p4
Any ideas?
Thanks,
stored procedure:
cmd.CommandText = "spSubjectCodesUpdate";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@subjectcode", SqlDbType.VarChar, 4, subjectCode);
cmd.Parameters["@subjectcode"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@subjectcode_desc", SqlDbType.VarChar, 60,
subjectCode_desc);
cmd.Parameters["@subjectcode_desc"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@active", SqlDbType.VarChar, 1,active);
cmd.Parameters["@active"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@retval", SqlDbType.VarChar, 250,null);
cmd.Parameters["@retval"].Direction = ParameterDirection.InputOutput;
conn.Open();
string result = Convert.ToString(cmd.ExecuteScalar());
When I run this, I get an unhandled exception:
Procedure or Function 'spSubjectCodesUpdate' expects parameter
'@subjectcode', which was not supplied.
The profiler only says this:
declare @p4 varchar(250)
set @p4=default
exec spSubjectCodesUpdate
@subjectcode=default,@subjectcode_desc=default,@active=default,@retval=@p4
output
select @p4
Any ideas?
Thanks,