62,041
社区成员
发帖
与我相关
我的任务
分享
for (int i = 0; i < lv_information.Items.Count; i++)
{
string sql_str = "INSERT INTO contact (contact_name,contact_group,contact_key,contact_value,contact_ragion" +
(i == 0 ? ",ID,contact_name_region" : "") + ") VALUES('" + tb_con_name.Text + "','" + cb_con_workgroup.Text + "','" + lv_information.Items[i].SubItems[0].Text
+ "','" + lv_information.Items[i].SubItems[1].Text + "','" + lv_information.Items[i].SubItems[2].Text + "'"
+ (i == 0 ? ",'" + pic_id + "','" + tb_name_region.Text + "'" : "") + ")";
if (sql.RunSql(sql_str) == false)
{
MessageBox.Show("服务器连接错误!");
return;
}
}