SqlDbType[] lx = new SqlDbType[11];
lx[0] = SqlDbType.NVarChar;
lx[1] = SqlDbType.NVarChar;
lx[2] = SqlDbType.NVarChar;
lx[3] = SqlDbType.NVarChar;
lx[4] = SqlDbType.NVarChar;
lx[5] = SqlDbType.NVarChar;
lx[6] = SqlDbType.NVarChar;
lx[7] = SqlDbType.NVarChar;
lx[8] = SqlDbType.NVarChar;
lx[9] = SqlDbType.NVarChar;
lx[10] = SqlDbType.NVarChar;
string[,] strs = new string[11, 2];
strs[0, 0] = "@ldrq"; strs[0, 1] = dtpldrq.Value.ToString();
strs[1, 0] = "@gys"; strs[1, 1] = cbogys.SelectedValue.ToString();
strs[3, 0] = "@spbh"; strs[3, 1] = cbospbh.Text;
strs[4, 0] = "@spmc"; strs[4, 1] = txtspmc.Text;
strs[5, 0] = "@dw"; strs[5, 1] = txtdw.Text;
strs[6, 0] = "@sl"; strs[6, 1] = txtsl.Text;
strs[7, 0] = "@jj"; strs[7, 1] = txtjj.Text;
strs[8, 0] = "@yfje"; strs[8, 1] = txtyfje.Text;
strs[9, 0] = "@sfje"; strs[9, 1] = txtsfje.Text;
strs[10, 0] = "@djbh"; strs[10, 1] = lbldjbh.Text;
String sql = "insert jhb values(@djbh,@ldrq,@gys,@jsr,@spbh,@spmc,@dw,@sl,@jj,@yfje,@yfje,0)"; //带?参?数簓的?增?加ó
if (dbclass.ExecuteSql(sql, strs, lx))
{
MessageBox.Show("增?加ó成é功|", "提?示?");
showdb();
qk();
btndy.Enabled = true;
lbldjbh.Text = getdate();
dtpldrq.Enabled = cbogys.Enabled = txtjsr.Enabled = txtyfje.Enabled = txtsfje.Enabled = cbospbh.Enabled = txtspmc.Enabled = txtdw.Enabled = txtsl.Enabled = txtjj.Enabled = false;
}
else
{
MessageBox.Show("失骸?败悒?, "提?示?");
}