Imports MySql.Data.MySqlClient Imports System.Drawing.Printing Module sumperpurokFullData 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 fillistT1full() Try Dim table As New DataTable() 'Dim i As Integer = 0 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t1.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception ' MsgBox(ex.Message) Finally End Try fillistT2full() End Sub Sub fillistT2full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where address = '" & databypurok.DataGridView1.Rows(1).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) 'pagingDS2 = New DataSet() 'adapter.Fill(pagingDS2, "full_data_table") 'sRecord_Count = pagingDS2.Tables(0).Rows.Count If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.t2.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT3full() End Sub Sub fillistT3full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where address = '" & databypurok.DataGridView1.Rows(2).Cells(0).Value & "' AND barangay = '" & databypurok.barangay.Text & "'", conn) adapter.Fill(table) 'pagingDS2 = New DataSet() 'adapter.Fill(pagingDS2, "full_data_table") 'sRecord_Count = pagingDS2.Tables(0).Rows.Count If databypurok.DataGridView1.RowCount > -1 Then Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count databypurok.t3.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT4full() End Sub Sub fillistT4full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t4.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT5full() End Sub Sub fillistT5full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t5.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT6full() End Sub Sub fillistT6full() Try Dim table As New DataTable() 'Dim i As Integer = 1 conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t6.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT7full() End Sub Sub fillistT7full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t7.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT8full() End Sub Sub fillistT8full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t8.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT9full() End Sub Sub fillistT9full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t9.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT10full() End Sub Sub fillistT10full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t10.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT11full() End Sub Sub fillistT11full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t11.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT12full() End Sub Sub fillistT12full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t12.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT13full() End Sub Sub fillistT13full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t13.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT14full() End Sub Sub fillistT14full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t14.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT15full() End Sub Sub fillistT15full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t15.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT16full() End Sub Sub fillistT16full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t16.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT17full() End Sub Sub fillistT17full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t17.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try fillistT18full() End Sub Sub fillistT18full() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data 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.t18.Text = lst End If conn.Close() conn.Dispose() Catch ex As Exception 'MsgBox(ex.Message) Finally End Try End Sub End Module