过程或函数'SP_Qualification_insert'需要参数'@Qualification_name',这是未提供的。 [英] Procedure or function 'SP_Qualification_insert' expects parameter '@Qualification_name', which was not supplied.

查看:85
本文介绍了过程或函数'SP_Qualification_insert'需要参数'@Qualification_name',这是未提供的。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过程或函数'SP_Qualification_insert'需要参数'@Qualification_name',这是未提供的。



我正在尝试将Qualification_add页面中的资格名称添加到Candidate_add bt数据绑定。但我无法创造。请帮我完成我的页面。所有页面都在下面给出....请尽快给我解决方案



CANDIDATE_ADD PAGE

 <%@     Page    语言  =  C#    AutoEventWireup   =   true    CodeFile  < span class =code-keyword> =  Candidate_Add.aspx.cs   < span class =code-attribute>继承  =  Candidate_Candidate_Add   %>  

< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN < span class =code-attribute>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd >
< html xmlns = http://www.w3.org/1999/xhtml\">
< head runat = 服务器 >
< title > < / title >
< span class =code-keyword>< / head >
< body >
< 表格 id = form1 runat = server >
< div >
< table >
< tr >
< td >
候选人姓名:
< / td >
< td >
< asp:TextBox ID = txt_Candidate_Name runat = 服务器 >
< / td >
< / tr >
< tr >
< td & gt;
配置文件:
< / td >
< td < span class =code-keyword>>
< asp:DropDownList ID = ddl_Profile runat = 服务器 >

< / td >
< / tr >
< tr >
< td >
电子邮件:
< / td >
< td >
< asp:TextBox ID = txt_Email runat = server >
< < span class =code-lead属性> / td >
< / tr >
< tr >
< td >
性别:
< ; / td >
< td >
< asp:RadioButtonList ID = rdb_Gender runat = server RepeatColumns = 2 >
< asp:ListItem 文字 = 男性 < span class =code-keyword> = 1 >
< asp:ListItem 文字 = 女性 = 2 >

< < span class =code-leadattribute> / td >
< / tr >
< tr >
< td >
资格:
< / td >
< td >
< asp:DropDownList ID = ddl_Qualification runat = server >

< / td >
< / tr >
< tr >
< td >
DOB:
< / td >
< td >
< asp:TextBox ID = txt_dob runat = 服务器 >
< / td >
< / tr >
< tr >
< td >
手机版No.:
< / td > ;
< td >
< asp:TextBox ID = txt_Mobile runat = < span class =code-keyword> server >
< / td >
< / tr >
< tr >
< td >
当前工资:
< / td >
< td >
< asp:TextBox ID = txt_CurrentSalary runat = server >
< / td >
< / tr >
< tr >
< td >
当前公司:
< / td >
< td >
< asp:TextBox ID = txt_CurrentCompany runat = server >
< / td > ;
< / tr >
< tr >
< td >
经验:
< / td >
< td >
< asp:DropDownList ID = ddl_year runat = server >
< asp:ListItem 文字 = 1 = 1 >
< asp:ListItem 文字 = 2 = 2 >
< asp:ListItem 文字 = 3 = 3 >
< asp:ListItem 文字 = 4 = 4 >
< asp:ListItem 正文 = 5 = 5 >

< asp:DropDownList ID = < span class =code-keyword> ddl_months runat = 服务器 >
< asp:ListItem 文字 = 1 = 1 >
< asp:ListItem 文字 = 2 = 2 >
< asp:ListItem 文字 = 3 = 3 >
< asp:ListItem 文字 = 4 = 4 >
< asp:ListItem 文字 = 5 = 5 >
< asp:ListItem 文字 = 6 = 6 >
< asp:ListItem Text = 7
= 7 >
< asp:ListItem 文本 = 8 = < span class =code-keyword> 8 >
< asp:ListItem 文本 = 9 = 9 >
< asp:ListItem 文本 = 10 = 10 >
< asp:ListItem 文本 = 11 = 11 >
< asp:ListItem 文字 = 12 = 12 >

< / td >
< < span class =code-leadattribute> / tr >
< tr >
< td >
参考名称:
< / td >
< <跨度class =code-leadattribute> td >
< < span class =code-leadattribute> asp:TextBox ID = txt_referenceName runat = server >
< / td >
< / tr >
< tr >
< td >
恢复上传:
< / td >
< td >
< asp:FileUpload ID = fu_resume runat = server / >
< / td >
< / tr >
< tr >
< td >
< / td >
< < span class =code-leadattribute> td >
< asp:按钮 ID = btn_Submit runat = server < /跨度> 文字 = 保存 OnClick = btn_Submit_Click / >
< / td > ;
< / tr >
< / table >
< / div >
< / form >
< / body >
< / html < span class =code-keyword>>





............ .................................................. ...............

CANDIDATE_ADD.ASPX.CS页

<前lang =Cs> 使用系统;
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Web;
使用 System.Web.UI;
使用 System.Web.UI.WebControls;
使用 System.Data;
使用 System.IO;
使用 System.Data.SqlClient;
使用 System.Configuration;

public partial class Candidate_Candidate_Add:System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings [ connection]。ConnectionString);
受保护 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

<!-- 
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\"/>
</authent ication>
<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>
</me mbership>
<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

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 i nt,
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, Quali fication, 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

<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeFile=\"Qualification_Add.aspx.cs\" Inherits=\"Admin_Qualification_Add\" %> 
$b$ b <!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/x html\">
<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

using System; 
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Web;
使用 System.Web.UI;
使用 System.Web.UI.WebControls;
使用 System.IO;
使用 System.Data;
使用 System.Data.SqlClient;
使用 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 P AGE

<%@ 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

using System; 
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Web;
使用 System.Web.UI;
使用 System.Web.UI.WebControls;
使用 System.Data.SqlClient;
使用 System.Configuration;
使用 System.Data;
使用 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



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>

解决方案

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.


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


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





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


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

<%@ 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

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

<!--
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

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

<%@ 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

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

<%@ 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

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

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>

解决方案

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.


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


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


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


这篇关于过程或函数'SP_Qualification_insert'需要参数'@Qualification_name',这是未提供的。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆