1
這個錯誤出現時,運行這段代碼多部分組成的標識符無法綁定
SqlConnection con = new SqlConnection(@"Data Source=SAMA-PC\SQLEXPRESS;Initial Catalog=meral10;Integrated Security=True");
SqlCommand comsel = new SqlCommand("SELECT email from reg where email ="+email_tb.Text,con);
con.Open();
comsel.ExecuteNonQuery();
con.Close();
if (comsel == null)
{
birthday = day_ddl.Text + "/" + month_ddl.Text + "/" + year_ddl.Text;
SqlCommand com = new SqlCommand("INSERT INTO reg(first_name,last_name,email,email_ver,pass,gender,birthday) values(@fn,@ln,@email,@reemail,@pass,@gen,@birth)", con);
con.Open();
com.Parameters.AddWithValue("@fn", firstname_tb.Text);
com.Parameters.AddWithValue("@ln", lastname_tb.Text);
com.Parameters.AddWithValue("@email", email_tb.Text);
com.Parameters.AddWithValue("@reemail", reemail_tb.Text);
com.Parameters.AddWithValue("@pass", pass_tb.Text);
com.Parameters.AddWithValue("@gen", gender_ddl.SelectedItem.Text);
com.Parameters.AddWithValue("@birth", birthday);
com.ExecuteNonQuery();
con.Close();}