Dim a As Integer Dim alar As New ArrayList For a = 0 To DataGridView1.Rows.Count - 1 If DataGridView1.Rows(a).Cells(0).Selected = True Then alar.Add(DataGridView1.Rows(a).Cells("cardno").Value) DataGridView2.Rows.Add(DataGridView1.Rows(a).Cells(0).Value, DataGridView1.Rows(a).Cells(1).Value, DataGridView1.Rows(a).Cells(2).Value, DataGridView1.Rows(a).Cells(3).Value, DataGridView1.Rows(a).Cells(4).Value) End If Next '-------------------------------------------------- Dim count As Integer = alar.Count Dim dsfs = alar.Item(0).ToString '--------------------------------------------------- For i = 0 To alar.Count - 1 dsfs = alar.Item(0).ToString Dim cn As New OleDbConnection Dim cmd As New OleDbCommand cn.ConnectionString = My.Settings.trialConnectionString cn.Open() cmd.Connection = cn cmd.CommandType = CommandType.Text ' For i = 0 To DataGridView1.Rows.Count - 1 Dim ab As String ab = DataGridView1.CurrentRow.Cells("cardno").Value cmd.CommandText = "update voter set Castt='" & ToolStripComboBox1.Text & "' where cardno= '" & alar.Item(0).ToString & "'" cmd.ExecuteNonQuery() ' Next cn.Close() Next If res > 0 Then MsgBox("Record Not Update") al.Clear() Else MsgBox("Record Update") End If 'End If '---------------Roemove selected row int gridview------------------' Dim row As Integer Dim selRow As New DataGridViewRow Dim index As Integer index = DataGridView1.SelectedRows.Item(0).Index selRow = DataGridView1.Rows.Item(index) DataGridView1.Rows.Remove(selRow) row = row - 1 End If ' MsgBox("Allocate Voter to " + ToolStripComboBox1.Text) End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)