Dim nm As String = sfh
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText ="Select * From {hkxx} Where 身份证号 = '" & nm & "'"
If sfh="" Then
Messagebox.Show("身份证不能为空","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel=True
Else
If cmd.ExecuteScalar > 0 Then
Messagebox.Show("已经存在该公民信息","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
cmd.CommandText = "Insert Into hkxx (户号,姓名,户主与户主关系,曾用名,性别,出生地,民族,籍贯,出生日期,本市其他地址,宗教信仰,身份证号,身高,血型,文化程度,婚姻状况,兵役状况,服务处所,职业,何时由何地迁来本市县,何时由何地迁来本址,承办人签章,登记日期,家庭类型,简码) values ('" & hh & "','" & xm & "','" & gx & "','" & cym & "','" & xb & "','" & csd & "','" & mz & "','" & jg & "','" & cdate(csrq) & "','" & dz & "','" & xy & "','" & sfh & "','" & sg & "','" & xx & "','" & wh & "','" & hk & "','" & by & "','" & fw & "','" & zy & "','" & hd & "','" & hs & "','" & qz & "','" & djrq & "','" & jtlx & "','" & jm & "')"
cmd.ExecuteNonQuery()
Messagebox.Show("保存成功","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
DataTables("mm_Table1").load
End If
End If