INSERT 语句中列的数目小于 VALUES 子句中指定的值的数目。
sql语句如下
sqlstr= "insert into position(ptname,ptnumber,ptsalary,ptaddress,ptdetail.ptsex,ptage,ptdegree,ptexperice) values( ' "+TextBox1.Text.ToString()+ " ', ' "+TextBox2.Text.ToString()+ " ', ' "+TextBox3.Text.ToString()+ " ', ' "+TextBox4.Text.ToString()+ " ', ' "+TextBox6.Text.ToString()+ " ', ' "+DropDownList1.SelectedItem.Text.ToString()+ " ', ' "+TextBox5.Text.ToString()+ " ', ' "+DropDownList2.SelectedItem.Text.ToString()+ " ', ' "+TextBox7.Text.ToString()+ " ') ";
------解决方案--------------------ptdetail.ptsex,
上面这个是不是写错了?应该是:
ptdetail,ptsex,
------解决方案--------------------ptdetail.ptsex,
上面这个是不是写错了?应该是:
ptdetail,ptsex,