ASP.NET - Procedure or Function expects parameter '@photo', which was not suppl

Asked By mani on 22-Feb-11 04:16 AM
hi..
i am getting following error..

Procedure or Function 'sp_temp' expects parameter '@photo', which was not supplied.


this is stored procedure..
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go







alter procedure [dbo].[sp_temp]
(
@id nvarchar(50),
@name nvarchar(550),
           @dob nvarchar(550),
           @gender nvarchar(550),
           @timeofbirth nvarchar(550),
           @placeofbirth nvarchar(550),
@religion nvarchar(550),
           @mothertongue nvarchar(550),
           
           @nativity nvarchar(550),
@maritalstatus nvarchar(550),
           @house nvarchar(550),
           @statuspropertydetails nvarchar(550),
           @fathername nvarchar(550),
           @mothername nvarchar(550),
           @fatherjob nvarchar(550),
           @motherjob nvarchar(550),
           @father nvarchar(550),
           @mother nvarchar(550),
           @melderbrother nvarchar(550),
           @myoungerbrother nvarchar(550),
           @meldersister nvarchar(550),
           @myoungersister nvarchar(550),
           @unelderbrother nvarchar(550),
           @unyoungerbrother nvarchar(550),
           @uneldersister nvarchar(550),
           @unyoungersister nvarchar(550),
           @otherdetails nvarchar(550),
           @qualification nvarchar(550),
           @job nvarchar(550),
           @placeofjob nvarchar(550),
           @income nvarchar(550),
           @height nvarchar(550),
           @weight nvarchar(550),
           @bloodgroup nvarchar(550),
           @physicalstatus nvarchar(550),
           @diet nvarchar(550),
           @caste nvarchar(550),
           @subcaste nvarchar(550),
           @star nvarchar(550),
           @raasi nvarchar(550),
           @padam nvarchar(550),
           @laknam nvarchar(550),
           @gothram nvarchar(550),

@dasa nvarchar(550),
@days nvarchar(550),
@months nvarchar(550),
@years nvarchar(550),
@rasi1 nvarchar(550),
@rasi2 nvarchar(550),
@rasi3 nvarchar(550),
@rasi4 nvarchar(550),
@rasi5 nvarchar(550),

@rasi7 nvarchar(550),
@rasi6 nvarchar(550),
@rasi8 nvarchar(550),
@rasi9 nvarchar(550),
@rasi10 nvarchar(550),
@rasi11 nvarchar(550),
@rasi12 nvarchar(550),
@amsam1 nvarchar(550),
@amsam2 nvarchar(550),
@amsam3 nvarchar(550),
@amsam4 nvarchar(550),
@amsam5 nvarchar(550),

@amsam7 nvarchar(550),
@amsam6 nvarchar(550),
@amsam8 nvarchar(550),
@amsam9 nvarchar(550),
@amsam10 nvarchar(550),
@amsam11 nvarchar(550),
@amsam12 nvarchar(550),
  @permanentaddress nvarchar(550),
           @presentaddress nvarchar(550),
@contactperson nvarchar(550),
 @phoneno nvarchar(550),
           @mobileno nvarchar(550),
          
           @emailid nvarchar(550),
           @p_qualification nvarchar(550),
          
           @p_job nvarchar(550),
 @p_placeofjob nvarchar(550),
           @p_income nvarchar(550),
           @p_age1 nvarchar(550),
           @p_age2 nvarchar(550),
           @p_maritalstatus nvarchar(550),
@p_diet nvarchar(550),
@p_minordisability nvarchar(550),
           @p_caste nvarchar(550),
           @p_subcaste nvarchar(550),
           @p_star nvarchar(550),
           @p_raasi nvarchar(550),
           @otherexceptations nvarchar(550),
           @scheme nvarchar(550),
@photo nvarchar(550),@complexion nvarchar(550),
@photo1 nvarchar(550),
@regmonth nvarchar(550),
@photo2 nvarchar(550),
@expmonth nvarchar(550),
@status nvarchar(550),
@age int,
@ephysicalstatus nvarchar(550),
@username nvarchar(50),
@password nvarchar(50)


)
as
insert into temp
values
(
@id,
@name,
           @dob,
           @gender,
           @timeofbirth,
           @placeofbirth,
@religion,
           @mothertongue,
           
           @nativity,
@maritalstatus,
           @house,
           @statuspropertydetails,
           @fathername,
           @mothername,
           @fatherjob,
           @motherjob,
           @father,
           @mother,
           @melderbrother,
           @myoungerbrother,
           @meldersister,
           @myoungersister,
           @unelderbrother,
           @unyoungerbrother,
           @uneldersister,
           @unyoungersister,
           @otherdetails,
           @qualification,
           @job,
           @placeofjob,
           @income,
           @height,
           @weight,
           @bloodgroup,
           @physicalstatus,
           @diet,
           @caste,
           @subcaste,
           @star,
           @raasi,
           @padam,
           @laknam,
           @gothram,

@dasa,
@days,
@months,
@years,
@rasi1,
@rasi2,
@rasi3,
@rasi4,
@rasi5,

@rasi7,
@rasi6,
@rasi8,
@rasi9,
@rasi10,
@rasi11,
@rasi12,
@amsam1,
@amsam2,
@amsam3,
@amsam4,
@amsam5,

@amsam7,
@amsam6,
@amsam8,
@amsam9,
@amsam10,
@amsam11,
@amsam12,
@permanentaddress,
           @presentaddress,
@contactperson,
@phoneno,
           @mobileno,
           
           @emailid,
           @p_qualification,
          
           @p_job,
 @p_placeofjob,
           @p_income,
           @p_age1,
           @p_age2,
           @p_maritalstatus,
@p_diet,
@p_minordisability,
           @p_caste,
           @p_subcaste,
           @p_star,
           @p_raasi,
           @otherexceptations,
           @scheme,
@photo,@complexion,@photo1,
@regmonth,@photo2,@expmonth,@status,@age,@ephysicalstatus,@username,@password
)

and my coding is

 SqlCommand cmd1 = new SqlCommand("sp_temp", conn);

      cmd1.CommandType = CommandType.StoredProcedure;


      string[] column = new string[]
          { "@id",
           "@name",
           "@dob",
           "@gender",
           "@timeofbirth",
           "@placeofbirth",
           "@religion",
           "@mothertongue",
           
           "@nativity",
           "@maritalstatus",
           "@house",
           "@statuspropertydetails",
           "@fathername",
           "@mothername",
           "@fatherjob",
           "@motherjob",
           "@father",
           "@mother",
           "@melderbrother",
           "@myoungerbrother",
           "@meldersister",
           "@myoungersister",
           "@unelderbrother",
           "@unyoungerbrother",
           "@uneldersister",
           "@unyoungersister",
           "@otherdetails",
           "@qualification",
           "@job",
           "@placeofjob",
           "@income",
           "@height",
           "@weight",
           "@bloodgroup",
           "@physicalstatus",
           "@diet",
           "@caste",
           "@subcaste",
           "@star",
           "@raasi",
           "@padam",
           "@laknam",
           "@gothram",
           "@dasa",
           "@days",
           "@months",
           "@years",
           "@rasi1",
"@rasi2",
"@rasi3",
"@rasi4",
"@rasi5",

"@rasi7",
"@rasi6",
"@rasi8",
"@rasi9",
"@rasi10",
"@rasi11",
"@rasi12",
"@amsam1",
"@amsam2",
"@amsam3",
"@amsam4",
"@amsam5",

"@amsam7",
"@amsam6",
"@amsam8",
"@amsam9",
"@amsam10",
"@amsam11",
"@amsam12",
           "@permanentaddress",
           "@presentaddress",
           "@contactperson",
           "@phoneno",
           "@mobileno",
           
           "@emailid",
           "@p_qualification",
           
           "@p_job",
           "@p_placeofjob",
           "@p_income",
           "@p_age1",
           "@p_age2",
           "@p_maritalstatus",
           "@p_diet",
           "@p_minordisability",
           "@p_caste",
           "@p_subcaste",
           "@p_star",
           "@p_raasi",
           "@otherexceptations",
           "@scheme",
           "@photo","@complexion","@photo1","@regmonth","@photo2","@expmonth","@status","@age","@ephysicalstatus","@username","@password"

  };
      string[] value = new string[]
          {
            id,
   strname,
   strdob,
   strgender,
    strtimeofbirth,
   strplaceofbirth ,
   strreligion,
    strmothertongue,
     
   strnativity ,
   strmaritalstatus ,
   strhouse,
   strstatusproperty ,
    strfathername,
   strmothername ,
   strfatherjob,
   strmotherjob,
   strfather,
    strmother,
   strmelderbrother,
   strmyoungerbrother ,
    strmeldersister,
   strmyoungersister ,
   strunelderbrother,
    strunyoungerbrother,
   struneldersister ,
   strunyoungersister,
   strotherdetails,
   strqualification,
   strjob ,
   strplaceofjob ,
   strincome,
   strheight,
   strweight ,
    strbloodgroup,
   strphysicalstatus,
   strdiet,
   strcaste,
   strsubcaste ,
    strstar,
   strraasi,
    strpadam ,
   strlaknam ,
   strgothram ,
    Dasa,
   Day,
   Month,
   Year,
   Rasi1,
     Rasi2,
    Rasi3,
    Rasi4,
     Rasi5,
     Rasi6,
     Rasi7,
    Rasi8,
    Rasi9,
    Rasi10,
    Rasi11,
    Rasi12,
   Amsam1,
   Amsam2,
   Amsam3,
   Amsam4,
   Amsam5,
    Amsam6,
   Amsam7,
   Amsam8,
   Amsam9,
    Amsam10,
    Amsam11,
   Amsam12,
   strpermanentaddress,
   strpresentaddress,
   strcontactperson,
   strmobileno,
    strlandline,
   emailid ,
    qualification ,
    
    job,
   placeofjob ,
   income,
   prefferedage1,
   prefferedage2,
    maritalstatus,
    diet,
    strminor,
    caste,
   subcaste,
   star,
   raasi,
   comments,
   scheme,
   strPhoto1,strComplexion,strPhoto2,"NULL",strphoto3,"NULL",status,years.ToString(),ephysicalstatus,username,password

          };

please help anyone...









div v replied to mani on 22-Feb-11 06:22 AM
hi,


  value is not passing  to @photo  parameter..thats wy your getting this error....check your procedure once again....