Procedure or function has too many arguments specified #2
<p>hi i have tried to insert the data to data base, make use of class files.. I have two classes, from that one is Material.cs, and DataAccessLayer.cs. But executing my code i got error like <strong>Procedure or function sp_insert_componet has too many arguments specified.""</strong></p>

<p>//From Material.cs</p>

<pre><code>private string strCREATEDBY;
private string strCREATEDDATE;
private string strUPDATEDBY;
private string strUPDATEDDATE;
private string strSTATUS;

public string Createdby
{
    get
    {
        return strCREATEDBY;
    }
    set
    {
        strCREATEDBY = value;
    }
}
public string Createddate
{
    get
    {
        return strCREATEDDATE;
    }
    set
    {
        strCREATEDDATE = value;
    }
}
public string Updateddate
{
    get
    {
        return strUPDATEDDATE;
    }
    set
    {
        strUPDATEDDATE = value;
    }
}
public string Updatedby
{
    get
    {
        return strUPDATEDBY;
    }
    set
    {
        strUPDATEDBY = value;
    }
}
public string Status
{
    get
    {
        return strSTATUS;
    }
    set
    {
        strSTATUS = value;
    }
}

//Maingroup
//created by : ramya
//created date:15.2.2012
private string strIDENTIFY;
private string strNO;
private string strNAME;
private string strMAINIDENTIFICATION;


public string Identification
{
    get
    {
        return strIDENTIFY;
    }
    set
    {
        strIDENTIFY = value;
    }
}
public string NO
{
    get
    {
        return strNO;
    }
    set
    {
        strNO = value;
    }
}
public string NAME
{
    get
    {
        return strNAME;
    }
    set
    {
        strNAME = value;
    }
}
public string Mainidentify
{
    get
    {
        return strMAINIDENTIFICATION;
    }
    set
    {
        strMAINIDENTIFICATION = value;
    }
}
private string strItemtype;
public string Itemtype
{
    get
    {
        return strItemtype;
    }
    set
    {
        strItemtype = value;
    }
}
private string strSitename;
public string Sitename
{
    get
    {
        return strSitename;
    }
    set
    {
        strSitename = value;
    }
}

public int Savecomponent()
{
    objDL.Addparam("@Createdby", Createdby);
    objDL.Addparam("@Createddate", Createddate);
    objDL.Addparam("@Sitecode", NO);
    objDL.Addparam("@Itemtype", Itemtype);
    objDL.Addparam("@Status", Status);
    objDL.Addparam("@Maingroupsno", Mainidentify);
    objDL.Addparam("@Subgroupsno", Identification);
    objDL.Addparam("@Componetcode",NAME);
    objDL.Addparam("@Sitename", Sitename);
    int save = objDL.insert("sp_insert_componet");
    if (save &gt; 0)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
</code></pre>

<p>//From DataAccessLayer.cs</p>

<pre><code>public int insert(string strInsert)
{
    try
    {
        Con.Open();
        cmd.Connection = Con;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = strInsert;
        int RetInsert = cmd.ExecuteNonQuery();
        return RetInsert;
    }
    catch (Exception ex)
    {
        throw ex;
    }
    //got error in this finally block

    finally
    {
        Con.Close();
    }
}
</code></pre>
