Procedure or function PR_GETBENEFICIARYIMAGE has too many arguments spefified

  • Thread starter Thread starter Shardev2020
  • Start date Start date
S

Shardev2020

Guest
Still another problem.

I wrote the following stored procedure for a LocalDB database:

CREATE PROCEDURE PR_GETBENEFICIARYIMAGE
@IdBen int
AS
SELECT benPhoto FROM Beneficiary
WHERE Id = @IdBen



I used the following C# code to call it:

public DataTable ShowBeneficiaryPhoto(int id)
{
DAL.Open();
DataTable dt = new DataTable();
SqlParameter[] pr = new SqlParameter[1];
pr[0] = new SqlParameter("@IdBen", SqlDbType.Int);
pr[0].Value = id;
dt = DAL.Read("PR_GETBENEFICIARYIMAGE", pr);
DAL.Close();
return dt;
}


Despite the number of arguments is the same (one argument) I got the following error when calling it:

Procedure or function PR_GETBENEFICIARYIMAGE has too many arguments specified.


I am unable to solve the problem.

Continue reading...
 
Back
Top