Hi Code Masters,
I am an ASP beginner, I have a stored precodure which accepts two input parameters. In my ASP project, I have a button click event
In my Helper.cs, I have a method as
But when I run the code, error message is always Procedure or function 'Concept_Insert ' expects parameter '@keyword', which was not supplied.
How can I pass those two parameters together to the stored procedure? Thanks in advanced.
I am an ASP beginner, I have a stored precodure which accepts two input parameters. In my ASP project, I have a button click event
Code:
protected void OnAddClick(object sender, EventArgs e)
{
string concept = txtConcept.Text;
string keyword = txtKeyword.Text;
.......
int result = Helper.ConceptInsert(concept,keyword);
}
Code:
public static int ConceptInsert(string description, string keyword)
{
int result = -1;
string connString = ConfigurationManager.ConnectionStrings["MySpaceConnectionString"].ConnectionString;
string commString = "exec dbo.Concept_Insert @description";
using (SqlConnection conn = new SqlConnection(connString))
{
using (SqlCommand comm = new SqlCommand(commString, conn))
{
comm.Parameters.Add(new SqlParameter("@description", description));
comm.Parameters.Add(new SqlParameter("@keyword", keyword));
conn.Open();
result = comm.ExecuteNonQuery();
}
}
return result;
}
How can I pass those two parameters together to the stored procedure? Thanks in advanced.
Comment