Click here to Skip to main content
15,919,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Procedure or function 'SP_Qualification_insert' expects parameter '@Qualification_name', which was not supplied.

I am trying to add Qualification name from my Qualification_add page to Candidate_add bt data binding. but i unable to creat. please help me to complete my pages. All pages are given below....please give me solution as soon as possible

CANDIDATE_ADD PAGE
HTML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Candidate_Add.aspx.cs" Inherits="Candidate_Candidate_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
Candidate Name :
</td>
<td>
<asp:TextBox ID="txt_Candidate_Name" runat="server">
</td>
</tr>
<tr>
<td>
Profile :
</td>
<td>
<asp:DropDownList ID="ddl_Profile" runat="server">

</td>
</tr>
<tr>
<td>
E-mail :
</td>
<td>
<asp:TextBox ID="txt_Email" runat="server">
</td>
</tr>
<tr>
<td>
Gender :
</td>
<td>
<asp:RadioButtonList ID="rdb_Gender" runat="server" RepeatColumns="2">
<asp:ListItem Text="Male" Value="1">
<asp:ListItem Text="Female" Value="2">

</td>
</tr>
<tr>
<td>
Qualification :
</td>
<td>
<asp:DropDownList ID="ddl_Qualification" runat="server">

</td>
</tr>
<tr>
<td>
DOB :
</td>
<td>
<asp:TextBox ID="txt_dob" runat="server">
</td>
</tr>
<tr>
<td>
Mobile No. :
</td>
<td>
<asp:TextBox ID="txt_Mobile" runat="server">
</td>
</tr>
<tr>
<td>
Current Salary :
</td>
<td>
<asp:TextBox ID="txt_CurrentSalary" runat="server">
</td>
</tr>
<tr>
<td>
Current Company :
</td>
<td>
<asp:TextBox ID="txt_CurrentCompany" runat="server">
</td>
</tr>
<tr>
<td>
Experience :
</td>
<td>
<asp:DropDownList ID="ddl_year" runat="server">
<asp:ListItem Text="1" Value="1">
<asp:ListItem Text="2" Value="2">
<asp:ListItem Text="3" Value="3">
<asp:ListItem Text="4" Value="4">
<asp:ListItem Text="5" Value="5">

<asp:DropDownList ID="ddl_months" runat="server">
<asp:ListItem Text="1" Value="1">
<asp:ListItem Text="2" Value="2">
<asp:ListItem Text="3" Value="3">
<asp:ListItem Text="4" Value="4">
<asp:ListItem Text="5" Value="5">
<asp:ListItem Text="6" Value="6">
<asp:ListItem Text="7" Value="7">
<asp:ListItem Text="8" Value="8">
<asp:ListItem Text="9" Value="9">
<asp:ListItem Text="10" Value="10">
<asp:ListItem Text="11" Value="11">
<asp:ListItem Text="12" Value="12">

</td>
</tr>
<tr>
<td>
Reference Name :
</td>
<td>
<asp:TextBox ID="txt_referenceName" runat="server">
</td>
</tr>
<tr>
<td>
Resume Upload :
</td>
<td>
<asp:FileUpload ID="fu_resume" runat="server" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btn_Submit" runat="server" Text="Save" OnClick="btn_Submit_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>


.............................................................................
CANDIDATE_ADD.ASPX.CS PAGE
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using System.Data.SqlClient;
using System.Configuration;

public partial class Candidate_Candidate_Add : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
Fill_Qualification();
Fill_Profile();

}

public void Fill_Profile()

{
con.Open();
SqlCommand cmd = new SqlCommand("SP_profile_insert", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
ddl_Profile.DataTextField = "profile_name";
ddl_Profile.DataTextField = "profile_id";
ddl_Profile.DataBind();
con.Close();


}

public void Fill_Qualification()

{
con.Open();
SqlCommand CMD = new SqlCommand("SP_Qualification_insert", con);
CMD.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(CMD);
DataSet ds = new DataSet();
da.Fill(ds);
ddl_Qualification.DataTextField = "Qualification_name";
ddl_Qualification.DataTextField = "Qualification_id";
ddl_Qualification.DataSource = ds;
ddl_Qualification.DataBind();
con.Close();
}
protected void btn_Submit_Click(object sender, EventArgs e)
{
con.Open();
int Exp = int.Parse(ddl_year.SelectedValue) * 12 + int.Parse(ddl_months.SelectedValue);
string fileName = Path.GetFileName(fu_resume.PostedFile.FileName);
string Location = Server.MapPath("Resume" + "\\" + fileName);
fu_resume.SaveAs(Location);

SqlCommand CMD = new SqlCommand("SP_Candidate_insert", con);
CMD.CommandType = CommandType.StoredProcedure;

CMD.Parameters.AddWithValue("@CandidateName", txt_Candidate_Name.Text);
CMD.Parameters.AddWithValue("@CandidateProfile", ddl_Profile.SelectedValue);
CMD.Parameters.AddWithValue("@Email", txt_Email.Text);
CMD.Parameters.AddWithValue("@Gender", rdb_Gender.SelectedValue);
CMD.Parameters.AddWithValue("@Qualification", ddl_Qualification.SelectedValue);
CMD.Parameters.AddWithValue("@DOB", txt_dob.Text);
CMD.Parameters.AddWithValue("@MobileNo", txt_Mobile.Text);
CMD.Parameters.AddWithValue("@CurrentSalary", txt_CurrentSalary.Text);
CMD.Parameters.AddWithValue("@CurrentCompany", txt_CurrentCompany.Text);
CMD.Parameters.AddWithValue("@Experience", Exp);
CMD.Parameters.AddWithValue("@ReferenceName", txt_referenceName.Text);
CMD.Parameters.AddWithValue("@FileUpload", fileName);
CMD.ExecuteNonQuery();
con.Close();


}

}


..........................................................
WEB CONFIG
XML
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionstrings>
<add name="connection" connectionstring="Data Source=BABAI_BONY-PC\SQLEXPRESS;Initial catalog=CONSULTANCY;Integrated Security=True" />
</connectionstrings>
<system.web>
<compilation debug="true" targetframework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionstringname="ApplicationServices" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="ApplicationServices" applicationname="/" />
</providers>
</profile>
<rolemanager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionstringname="ApplicationServices" applicationname="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationname="/" />
</providers>
</rolemanager>
</system.web>
<system.webserver>
<modules runallmanagedmodulesforallrequests="true" />
</system.webserver>
</configuration>

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
DATABASE FOR CANDIDATE PAGE
SQL
CREATE DATABASE CONSULTANCY

USE CONSULTANCY

Create Table Candidate
(
Candidate_ID int primary key identity(1,1),
CandidateName nvarchar(50),
CandidateProfile int,
Email nvarchar(50),
Gender int,
Qualification int,
DOB nvarchar(50),
MobileNo nvarchar(50),
CurrentSalary nvarchar(50),
CurrentCompany nvarchar(50),
Experience int,
ReferenceName nvarchar(50),
QualityRate int,
ClosingRate int,
IsDelete int default 0,
FileUpload nvarchar(max)
)

create proc SP_Candidate_insert
(
@CandidateName nvarchar(50),
@CandidateProfile int,
@Email nvarchar(50),
@Gender int,
@Qualification int,
@DOB nvarchar(50),
@MobileNo nvarchar(50),
@CurrentSalary nvarchar(50),
@CurrentCompany nvarchar(50),
@Experience int,
@ReferenceName nvarchar(50),
@FileUpload nvarchar(max)
)


as
begin
insert into Candidate( CandidateName, CandidateProfile, Email, Gender, Qualification, DOB, MobileNo, CurrentSalary, CurrentCompany, Experience, ReferenceName, FileUpload )

values(@CandidateName,@CandidateProfile, @Email, @Gender, @Qualification, @DOB, @MobileNo, @CurrentSalary, @CurrentCompany, @Experience, @ReferenceName, @FileUpload )

end


select * from Candidate

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,......................
QUALIFICATION_ADD PAGE
HTML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Qualification_Add.aspx.cs" Inherits="Admin_Qualification_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
Qualification :
</td>
<td>
<asp:TextBox ID="txt_Qualification" runat="server">
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btn_save" runat="server" Text="SAVE" OnClick="btn_save_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

,,,,,,,,,,,,,,,,,,.......................................,,,,,,,,,,,,,,,,,,,,,,,..........................
QUALIFICATION_ADD.ASPX.CS PAGE
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;


public partial class Admin_Qualification_Add : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);

protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_save_Click(object sender, EventArgs e)
{

con.Open();
SqlCommand cmd = new SqlCommand("SP_Qualification_insert", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Qualification_name", txt_Qualification.Text);
cmd.ExecuteNonQuery();
con.Close();
}
}
DATABASE FOR QUALIFICATION 
 
create table Qualification
( Qualification_id int primary key identity(1,1),
Qualification_name nvarchar(50),
IsDelete int default 0
)

create proc SP_Qualification_insert
(
@Qualification_name nvarchar(50)
)
as
begin
insert into Qualification (Qualification_name) values (@Qualification_name)
end

select * from Qualification


,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,............................................
PROFILE_ADD PAGE
HTML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Profile_Add.aspx.cs" Inherits="Admin_Profile_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
Profile Name :
</td>
<td>
<asp:TextBox ID="txt_profile" runat="server">
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btn_save" runat="server" Text="SAVE" OnClick="btn_save_Click"
ondatabinding="btn_save_DataBinding" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>


,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
PROFILE_ADD.ASPX.CS
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.IO;


public partial class Admin_Profile_Add : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);

protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_save_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = new SqlCommand("SP_profile_insert", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@profile_name ", txt_profile.Text);
cmd.ExecuteNonQuery();
con.Close();
}
protected void btn_save_DataBinding(object sender, EventArgs e)
{

}
}

........................................DATABASE
use CONSULTANCY

SQL
create table profile
( profile_id int primary key identity(1,1),
profile_name nvarchar(50),
IsDelete int default 0
)

create proc SP_profile_insert
(
@profile_name nvarchar(50)
)
as
begin
insert into profile (profile_name) values (@profile_name)
end


select * from profile<pre>
Posted
Updated 21-Jun-14 6:43am
v2
Comments
[no name] 21-Jun-14 12:24pm    
You are kidding right? What exactly does all of this code have to do with your problem? Read the error message. It tells you exactly what the problem is. Then go to the section of code where you are calling that SP and add a parameter for the qualification name.
Namith Krishnan E 23-Jun-14 7:13am    
?

In this code

con.Open();
 SqlCommand CMD = new SqlCommand("SP_Qualification_insert", con);
 CMD.CommandType = CommandType.StoredProcedure;
 SqlDataAdapter da = new SqlDataAdapter(CMD);


You have not created and populated a SQLParameter object.
 
Share this answer
 
In your procedure parameter name is @Qualification_name and in program it is @Qualification.Make both have the same name .

change the parameter name @Qualification in your program to @Qualification_name.This will solve ur problem
 
Share this answer
 
you are not supplying parameter @Qualification_name to your sp SP_Qualification_insert
in page-->
CANDIDATE_ADD.ASPX.CS PAGE
Function-->
public void Fill_Qualification()

as your sp required @Qualification_name parameter


SQL
create proc SP_Qualification_insert
(
@Qualification_name nvarchar(50)
)
as
begin
insert into Qualification (Qualification_name) values (@Qualification_name)
end

select * from Qualification


suggestion please create separated sp to fetch Qualification from database
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900