Private Sub Bedt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bedt.Click
Dim sql1 As String = "Server=localhost;User Id=jd1;Password=1234;Database=test"
Dim conn1 As New MySqlConnection(sql1)
conn1.Open()
Dim sqlcmd1 As String = "1 "
Dim cmd1 As New MySqlCommand(sqlcmd1, conn1)
Dim adapter1 As New MySqlDataAdapter(cmd1)
Dim data1 As New DataSet()
sqlcmd1 = "UPDATE test1 SET"
sqlcmd1 &= "ID =@id, Name =@nm, Tel=@tel"
sqlcmd1 &= "WHERE ID =" & TbxID.Text
For Each row As DataRow In dtData .Rows
If row.RowState <> DataRowState.Deleted Then
sbSql = New System.Text.StringBuilder()
sbSql.Append("INSERT INTO ABC_TABLE ")
sbSql.Append(" ID, ")
sbSql.Append(" NAME, ")
sbSql.Append(" ADDRESS ")
sbSql.Append("VALUES ( ")
sbSql.Append(" :pId, ")
sbSql.Append(" :pName, ")
sbSql.Append(" :pAddress ")
sbSql.Append(") ")
command.CommandText = sbSql.ToString()
command.Parameters.Clear()
command.Parameters.Add("pId", iDocId)
command.Parameters.Add("pName", row("PART_ID"))
command.ExecuteNonQuery()
End If
Next