新手请教:emp.ExecuteNonQuery();提示‘;’附近有语法错误。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class admin_JobsEdit : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string R_post = TextBox1.Text;
string R_place = TextBox2.Text;
string R_number = TextBox3.Text;
string R_wage = DropDownList1.Text;
string R_stime = TextBox5.Text;
string R_jtime = TextBox6.Text;
string R_unit = TextBox7.Text;
string R_person = TextBox8.Text;
string R_photo = TextBox9.Text;
string R_address = TextBox10.Text;
string R_code = TextBox11.Text;
string R_email = TextBox12.Text;
string R_duty = TextBox13.Text;
string R_requirement = TextBox14.Text;
string myconnstr = ConfigurationManager.ConnectionStrings["DBConnStr"].ConnectionString;
SqlConnection conn = new SqlConnection(myconnstr);
string SQLem = "insert into [recruitment] values(@R_post,@R_place,@R_number,@R_wage,@R_stime,@R_jtime,@R_unit,@R_person,@R_photo,@R_address,@R_code;@R_email;@R_duty;@R_requirement)";
SqlCommand emp = new SqlCommand(SQLem, conn);
conn.Open();
SqlParameter paranam2 = new SqlParameter("@R_post", R_post);
SqlParameter paranam3 = new SqlParameter("@R_place", R_place);
SqlParameter paranam4 = new SqlParameter("@R_number", R_number);
SqlParameter paranam5 = new SqlParameter("@R_wage", R_wage);
SqlParameter paranam6 = new SqlParameter("@R_stime", R_stime);
SqlParameter paranam7 = new SqlParameter("@R_jtime", R_jtime);
SqlParameter paranam8 = new SqlParameter("@R_unit", R_unit);
SqlParameter paranam9 = new SqlParameter("@R_person", R_person);
SqlParameter paranam10 = new SqlParameter("@R_photo", R_photo);
SqlParameter paranam11 = new SqlParameter("@R_address", R_address);
SqlParameter paranam12 = new SqlParameter("@R_code", R_code);
SqlParameter paranam13 = new SqlParameter("@R_email", R_email);
SqlParameter paranam14 = new SqlParameter("R_duty", R_duty);
SqlParameter paranam15 = new SqlParameter("R_requirement", R_requirement);
emp.Parameters.Add(paranam2);
emp.Parameters.Add(paranam3);
emp.Parameters.Add(paranam4);
emp.Parameters.Add(paranam5);
emp.Parameters.Add(paranam6);
emp.Parameters.Add(paranam7);
emp.Parameters.Add(paranam8);
emp.Parameters.Add(paranam9);
emp.Parameters.Add(paranam10);
emp.Parameters.Add(paranam11);
emp.Parameters.Add(paranam12);
emp.Parameters.Add(paranam13);
emp.Parameters.Add(paranam14);
emp.Parameters.Add(paranam15);
emp.ExecuteNonQuery();
con