Imports MySql.Data.MySqlClient Imports System.Drawing.Printing Module sumperpurokFullDataEntry Public sCon As MySqlConnection = New MySqlConnection Public sComand As MySqlDataAdapter = New MySqlDataAdapter Public ds As New DataSet Dim scrollVal As Integer Dim pagingAdapter As New MySqlDataAdapter Dim pagingDS As New DataSet Dim pagingDS2 As New DataSet Private sRecord_Count As Integer Dim conn As New MySqlConnection Dim cmd As New MySqlCommand Dim dr As MySqlDataReader Dim connectionString As New MySqlConnection("server=10.10.0.6;user id=corpadmin;password=admincorp2024;database=caragavotersdb;port=3706") Private Sub conns() 'Try conn = New MySqlConnection("server=10.10.0.6;user id=corpadmin;password=admincorp2024;database=caragavotersdb;port=3706") conn.Open() 'Catch ex As Exception ' MsgBox(ex.Message) 'End Try End Sub Sub fillistR1full() Try Dim table As New DataTable() 'Dim i As Integer = 0 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(0).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r1.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception ' MsgBox(ex.Message) Finally End Try fillistR2full() End Sub Sub fillistR2full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(1).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r2.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR3full() End Sub Sub fillistR3full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(2).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r3.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR4full() End Sub Sub fillistR4full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(3).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r4.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR5full() End Sub Sub fillistR5full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(4).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r5.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR6full() End Sub Sub fillistR6full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(5).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r6.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR7full() End Sub Sub fillistR7full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(6).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r7.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR8full() End Sub Sub fillistR8full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(7).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r8.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR9full() End Sub Sub fillistR9full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(8).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r9.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR10full() End Sub Sub fillistR10full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(9).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r10.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR11full() End Sub Sub fillistR11full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(10).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r11.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR12full() End Sub Sub fillistR12full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(11).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r12.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR13full() End Sub Sub fillistR13full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(12).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r13.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR14full() End Sub Sub fillistR14full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(13).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r14.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR15full() End Sub Sub fillistR15full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(14).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r15.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR16full() End Sub Sub fillistR16full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(15).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r16.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR17full() End Sub Sub fillistR17full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(16).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r17.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistR18full() End Sub Sub fillistR18full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where address = '" & databypurok.DataGridView1.Rows(17).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.r18.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try End Sub End Module