INSERT 语句中列的数目小于 VALUES 子句中指定的值的数目。VALUES 子句中值的数目 10
SqlCommandcmd=newSqlCommand("InsertINTOxyypxx1(chukudate,biaozhi,yewudy,chukufl,ypnam...
SqlCommand cmd = new SqlCommand("Insert INTO xyypxx1(chukudate,biaozhi,yewudy,chukufl,ypname,guige,pihao,churukucount,ypjiecunshu,jinhuojia,jinhuojiazong,lingshoujia,lingshoujiazong,danjuhao,changshang," + "yingkuijingzong,yingkuilingzong,ypqichushu,shixiaoriqi,ypbianma,jijiadanwei,baozhuangguige,jiecunxuhao,qichushu,jiecunshu,pici,beizhu,caizhifenlei,zhaobiaobiaozhi)VALUES('" + dataGridView1.Rows[i].Cells[0].Value.ToString().Trim() + "' " +
" ,'"+ dataGridView1.Rows[i].Cells[1].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[2].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[3].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[4].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[5].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[6].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[7].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[8].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[9].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[10].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[11].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[12].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[13].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[14].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[15].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[16].Value.ToString().Trim() + "'," +
" '" + dataGridView1.Rows[i].Cells[17].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[18].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[19].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[20].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[21].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[22].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[23].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[24].Value.ToString().Trim() + "','" +
"','"+ dataGridView1.Rows[i].Cells[25].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[26].Value.ToString().Trim() + "','" +
"','"+ dataGridView1.Rows[i].Cells[27].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[28].Value.ToString().Trim() + "')", con);
cmd.ExecuteNonQuery(); 展开
" ,'"+ dataGridView1.Rows[i].Cells[1].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[2].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[3].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[4].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[5].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[6].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[7].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[8].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[9].Value.ToString().Trim() + "','" + dataGridView1.Rows[i].Cells[10].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[11].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[12].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[13].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[14].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[15].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[16].Value.ToString().Trim() + "'," +
" '" + dataGridView1.Rows[i].Cells[17].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[18].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[19].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[20].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[21].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[22].Value.ToString().Trim() + "', " +
" '" + dataGridView1.Rows[i].Cells[23].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[24].Value.ToString().Trim() + "','" +
"','"+ dataGridView1.Rows[i].Cells[25].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[26].Value.ToString().Trim() + "','" +
"','"+ dataGridView1.Rows[i].Cells[27].Value.ToString().Trim()+ "','" + dataGridView1.Rows[i].Cells[28].Value.ToString().Trim() + "')", con);
cmd.ExecuteNonQuery(); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询