SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=J:\\source cod\\PROJECT C #\\ketabkhaneghaem\\ketabkhaneghaem\\Database1.mdf ;Integrated Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
DataSet ds =new DataSet();
if (txtfname.Text == "" || txtlname.Text == "" || txtcodozv.Text == "")
{
MessageBox.Show("وارد كردن کد عضویت ، نام و نام خانوادگي الزامي مي باشد");
}
else
{
conn.Open();
cmd.CommandText = ("insert into aza values('" + txtcodozv + "','" + txtfname + "','" + txtlname + "','" + txtnamepedar + "','" + textBox1 + "','" + txtmeli + "','" + txttelephon + "','" + txtaddress + "','" + textBox2 + "','" + textBox3 + "')");
cmd.Connection = conn;
cmd.ExecuteNonQuery();
conn.Close();
}
روی cmd.ExecuteNonQuery ارور میده
کل فیلد های جدولم nchar هست