更新数据集
Private Sub updata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updata.Click
imagepath = Application.StartupPath + "\face\ " + data.Tables(0).Rows(0).Item(6) + ".bmp "
a = a.FromFile(imagepath)
Else
Try
Dim strsql As String = "update cardinfo set(name=@name,old=@old,number=@number,address=@address,mail=@mail) "
Dim strcmd As New SqlCommand(strsql, sqlconn)
With data.Tables(0).Rows(0)
.Item(0).Parameters.Add(New SqlParameter( "@name ", SqlDbType.VarChar)).Value = nametxt.Text
.Item(2).Parameters.Add(New SqlParameter( "@old ", SqlDbType.Int)).Value = old.Text
.Item(4).Parameters.Add(New SqlParameter( "@number ", SqlDbType.VarChar)).Value = number.Text
If man.Checked.ToString = "男 " Then
.Item(1).Parameters.Add(New SqlParameter( "@sex ", SqlDbType.VarChar)).Value = "男 "
Else : .Item(1).Parameters.Add(New SqlParameter( "@sex ", SqlDbType.VarChar)).Value = "女 "
End If
.Item(3).Parameters.Add(New SqlParameter( "@address ", SqlDbType.VarChar)).Value = address.Text
.Item(5).Parameters.Add(New SqlParameter( "@mail ", SqlDbType.VarChar)).Value &n