Imports MySql.Data.MySqlClient Imports System.Drawing.Printing Public Class databybrgy 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 connStrr As String = "server=10.10.0.6;user id=corpadmin;password=admincorp2024;database=caragavotersdb;port=3706" 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 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'If CheckBox1.Checked = True Then ' CheckBox1.Checked = False 'Else ' CheckBox1.Checked = True 'End If 'Application.Restart() Me.Controls.Clear() 'removes all the controls on the form InitializeComponent() 'load all the controls again Graph_Load(e, e) 'MsgBox("Thank you for sending report", vbInformation, "") Refresh() End Sub Private Sub Graph_Load(sender As Object, e As EventArgs) Handles MyBase.Load alvar() CheckBox1.Checked = True CheckBox1.Visible = False totalalldata() End Sub Private Sub totalalldata() Label90.Text = Val(Dashboard.Label15.Text) Label92.Text = Val(Label2.Text) + Val(Label10.Text) + Val(Label14.Text) + Val(Label18.Text) + Val(Label22.Text) + Val(Label26.Text) + Val(Label30.Text) + Val(Label34.Text) + Val(Label38.Text) + Val(Label42.Text) + Val(Label46.Text) + Val(Label50.Text) + Val(Label87.Text) + Val(Label54.Text) + Val(Label58.Text) + Val(Label62.Text) + Val(Label66.Text) End Sub Private Sub totalremain() Label93.Text = Val(Label7.Text) + Val(Label11.Text) + Val(Label15.Text) + Val(Label19.Text) + Val(Label23.Text) + Val(Label27.Text) + Val(Label31.Text) + Val(Label35.Text) + Val(Label39.Text) + Val(Label43.Text) + Val(Label47.Text) + Val(Label51.Text) + Val(Label88.Text) + Val(Label55.Text) + Val(Label59.Text) + Val(Label63.Text) + Val(Label67.Text) End Sub Private Sub totalpercentrec() totalremain() 'Label7.Text = Label92.Text - Label90.Text Dim Total = Val(Label90.Text) / Val(Label92.Text) * 100 + 1 Total = Math.Floor(Total) Label91.Text = Total Label91.Text = Label91.Text + "%" totalpercentremain() End Sub Private Sub totalpercentremain() totalremain() 'Label7.Text = Label92.Text - Label90.Text Dim Total = Val(Label93.Text) / Val(Label92.Text) * 100 Total = Math.Floor(Total) Label95.Text = Total Label95.Text = Label95.Text + "%" End Sub '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== Private Sub alvar() 'Try ' Dim table As New DataTable() ' conns() ' Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'ALVAR' ", conn1) ' adapter.Fill(table) ' pagingDS2 = New DataSet() ' adapter.Fill(pagingDS2, "full_data_entry_table") ' sRecord_Count = pagingDS2.Tables(0).Rows.Count ' Dim lst = (From row In table.AsEnumerable ' Select row.Field(Of String)(0)).Count ' Label4.Text = lst ' conn1.Close() ' conn1.Dispose() 'Catch ex As Exception ' MsgBox(ex.Message) 'Finally 'End Try Dim querry As String = "SELECT COUNT(*) FROM full_data_entry where barangay LIKE 'ALVAR'" Using conn As New MySqlConnection(connStrr) Using cmd As New MySqlCommand() With cmd .Connection = conn .CommandText = querry .CommandType = CommandType.Text End With Try conn.Open() Dim count As Int16 = Convert.ToInt16(cmd.ExecuteScalar()) Label4.Text = Label4.Text + count 'Label14.Text = count ' MsgBox(count.ToString()) conn1.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Using End Using alvar2() End Sub Private Sub alvar2() 'Try ' Dim table As New DataTable() ' conns() ' Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay = 'ALVAR' ", conn1) ' adapter.Fill(table) ' pagingDS2 = New DataSet() ' adapter.Fill(pagingDS2, "full_data_entry_table") ' sRecord_Count = pagingDS2.Tables(0).Rows.Count ' Dim lst = (From row In table.AsEnumerable ' Select row.Field(Of String)(0)).Count ' Label2.Text = lst ' conn1.Close() ' conn1.Dispose() 'Catch ex As Exception ' MsgBox(ex.Message) 'Finally 'End Try Dim querry As String = "SELECT COUNT(*) FROM full_data where barangay = 'ALVAR'" Using conn As New MySqlConnection(connStrr) Using cmd As New MySqlCommand() With cmd .Connection = conn .CommandText = querry .CommandType = CommandType.Text End With Try conn.Open() Dim count As Int16 = Convert.ToInt16(cmd.ExecuteScalar()) Label2.Text = count 'Label14.Text = count ' MsgBox(count.ToString()) conn1.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Using End Using 'remainalvar() CANINGAG() End Sub Private Sub remainalvar() Label7.Text = Label2.Text - Label4.Text Dim Total = Val(Label4.Text) / Val(Label2.Text) * 100 Total = Math.Floor(Total) Label69.Text = Total Label69.Text = Label69.Text + "%" End Sub Private Sub CANINGAG() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'CANINGAG' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label9.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try CANINGAG2() End Sub Private Sub CANINGAG2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'CANINGAG' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label10.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainCANINGAG() BALANTE() End Sub Private Sub remainCANINGAG() Label11.Text = Label10.Text - Label9.Text Dim Total = Val(Label9.Text) / Val(Label10.Text) * 100 Total = Math.Floor(Total) Label70.Text = Total Label70.Text = Label70.Text + "%" End Sub Private Sub BALANTE() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'D.L. BALANTE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label13.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try BALANTE2() End Sub Private Sub BALANTE2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'D.L. BALANTE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label14.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try LAMIAWAN() 'remainBALANTE() End Sub Private Sub remainBALANTE() Label15.Text = Label14.Text - Label13.Text 'LAMIAWAN() Dim Total = Val(Label13.Text) / Val(Label14.Text) * 100 Total = Math.Floor(Total) Label71.Text = Total Label71.Text = Label71.Text + "%" End Sub Private Sub LAMIAWAN() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'LAMIAWAN' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label17.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try LAMIAWAN2() End Sub Private Sub LAMIAWAN2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'LAMIAWAN' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label18.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MANORIGAO() 'remainLAMIAWAN() End Sub Private Sub remainLAMIAWAN() Label19.Text = Label18.Text - Label17.Text 'MANORIGAO() Dim Total = Val(Label17.Text) / Val(Label18.Text) * 100 Total = Math.Floor(Total) Label72.Text = Total Label72.Text = Label72.Text + "%" End Sub Private Sub MANORIGAO() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'MANORIGAO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label21.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MANORIGAO2() End Sub Private Sub MANORIGAO2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'MANORIGAO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label22.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MERCEDES() 'remainMANORIGAO() End Sub Private Sub remainMANORIGAO() Label23.Text = Label22.Text - Label21.Text 'MERCEDES() Dim Total = Val(Label21.Text) / Val(Label22.Text) * 100 Total = Math.Floor(Total) Label73.Text = Total Label73.Text = Label73.Text + "%" End Sub Private Sub MERCEDES() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'MERCEDES' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label25.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MERCEDES2() End Sub Private Sub MERCEDES2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'MERCEDES' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label26.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PALMAGIL() 'remainMERCEDES() End Sub Private Sub remainMERCEDES() Label27.Text = Label26.Text - Label25.Text 'PALMAGIL() Dim Total = Val(Label25.Text) / Val(Label26.Text) * 100 Total = Math.Floor(Total) Label74.Text = Total Label74.Text = Label74.Text + "%" End Sub Private Sub PALMAGIL() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'PALMA GIL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label29.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PALMAGIL2() End Sub Private Sub PALMAGIL2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'PALMA GIL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label30.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PICHON() 'remainPALMAGIL() End Sub Private Sub remainPALMAGIL() Label31.Text = Label30.Text - Label29.Text 'PICHON() Dim Total = Val(Label29.Text) / Val(Label30.Text) * 100 Total = Math.Floor(Total) Label75.Text = Total Label75.Text = Label75.Text + "%" End Sub Private Sub PICHON() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'PICHON' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label33.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PICHON2() End Sub Private Sub PICHON2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'PICHON' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label34.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SOBRECAREY() 'remainPICHON() End Sub Private Sub remainPICHON() Label35.Text = Label34.Text - Label33.Text 'SOBRECAREY() Dim Total = Val(Label33.Text) / Val(Label34.Text) * 100 Total = Math.Floor(Total) Label76.Text = Total Label76.Text = Label76.Text + "%" End Sub Private Sub SOBRECAREY() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'P.M. SOBRECAREY' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label37.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SOBRECAREY2() End Sub Private Sub SOBRECAREY2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'P.M. SOBRECAREY' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label38.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try POBLACION() 'remainSOBRECAREY() End Sub Private Sub remainSOBRECAREY() Label39.Text = Label38.Text - Label37.Text 'POBLACION() Dim Total = Val(Label37.Text) / Val(Label38.Text) * 100 Total = Math.Floor(Total) Label77.Text = Total Label77.Text = Label77.Text + "%" End Sub Private Sub POBLACION() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'POBLACION' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label41.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try POBLACION2() End Sub Private Sub POBLACION2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'POBLACION' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label42.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainPOBLACION() SANANTONIO() End Sub Private Sub remainPOBLACION() Label43.Text = Label42.Text - Label41.Text 'SANANTONIO() Dim Total = Val(Label41.Text) / Val(Label42.Text) * 100 Total = Math.Floor(Total) Label78.Text = Total Label78.Text = Label78.Text + "%" End Sub Private Sub SANANTONIO() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SAN ANTONIO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label45.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANANTONIO2() End Sub Private Sub SANANTONIO2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SAN ANTONIO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label46.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANANTONIO() SANJOSE() End Sub Private Sub remainSANANTONIO() Label47.Text = Label46.Text - Label45.Text 'SANJOSE() Dim Total = Val(Label45.Text) / Val(Label46.Text) * 100 Total = Math.Floor(Total) Label79.Text = Total Label79.Text = Label79.Text + "%" End Sub Private Sub SANJOSE() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SAN JOSE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label49.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANJOSE2() End Sub Private Sub SANJOSE2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SAN JOSE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label50.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANJOSE() SANLUIS() End Sub Private Sub remainSANJOSE() Label51.Text = Label50.Text - Label49.Text 'SANLUIS() Dim Total = Val(Label49.Text) / Val(Label50.Text) * 100 Total = Math.Floor(Total) Label80.Text = Total Label80.Text = Label80.Text + "%" End Sub Private Sub SANLUIS() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SAN LUIS' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label85.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANLUIS2() End Sub Private Sub SANLUIS2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SAN LUIS' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label87.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANLUIS() SANMIGUEL() End Sub Private Sub remainSANLUIS() Label88.Text = Label87.Text - Label85.Text 'SANMIGUEL() Dim Total = Val(Label85.Text) / Val(Label87.Text) * 100 Total = Math.Floor(Total) Label86.Text = Total Label86.Text = Label86.Text + "%" End Sub Private Sub SANMIGUEL() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SAN MIGUEL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label53.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANMIGUEL2() End Sub Private Sub SANMIGUEL2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SAN MIGUEL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label54.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANMIGUEL() SANPEDRO() End Sub Private Sub remainSANMIGUEL() Label55.Text = Label54.Text - Label53.Text 'SANPEDRO() Dim Total = Val(Label53.Text) / Val(Label54.Text) * 100 Total = Math.Floor(Total) Label81.Text = Total Label81.Text = Label81.Text + "%" End Sub Private Sub SANPEDRO() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SAN PEDRO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label57.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANPEDRO2() End Sub Private Sub SANPEDRO2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SAN PEDRO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label58.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANPEDRO() SANTIAGO() End Sub Private Sub remainSANPEDRO() Label59.Text = Label58.Text - Label57.Text 'SANTIAGO() Dim Total = Val(Label57.Text) / Val(Label58.Text) * 100 Total = Math.Floor(Total) Label82.Text = Total Label82.Text = Label82.Text + "%" End Sub Private Sub SANTIAGO() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'SANTIAGO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label61.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANTIAGO2() End Sub Private Sub SANTIAGO2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'SANTIAGO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label62.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSANTIAGO() STAFE() End Sub Private Sub remainSANTIAGO() Label63.Text = Label62.Text - Label61.Text 'STAFE() Dim Total = Val(Label61.Text) / Val(Label62.Text) * 100 Total = Math.Floor(Total) Label83.Text = Total Label83.Text = Label83.Text + "%" End Sub Private Sub STAFE() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data_entry where barangay LIKE 'STA. FE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label65.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try STAFE2() End Sub Private Sub STAFE2() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT name FROM full_data where barangay LIKE 'STA. FE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "full_data_entry_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Label66.Text = lst conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try 'remainSTAFE() 'alvarhhl() End Sub Private Sub remainSTAFE() Label67.Text = Label66.Text - Label65.Text Dim Total = Val(Label65.Text) / Val(Label66.Text) * 100 Total = Math.Floor(Total) Label84.Text = Total Label84.Text = Label84.Text + "%" End Sub Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click 'Button2.Visible = False '' Set the PrintAction to display a Print Preview dialog 'PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview '' This prints a copy of the form as it appears in the PrintPreview 'PrintForm1.Print() '' Display the print button again on the form Button1.Visible = False Button2.Visible = False CheckBox1.Visible = False PrintForm1.Form = Me PrintForm1.PrinterSettings.Copies = 1 PrintForm1.PrinterSettings.DefaultPageSettings.Margins = New Printing.Margins(10, 10, 10, 10) PrintForm1.PrinterSettings.DefaultPageSettings.PaperSize.RawKind = Printing.PaperKind.Letter PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview PrintForm1.Print() Button1.Visible = True Button2.Visible = True CheckBox1.Visible = False End Sub '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged loadingform.Show() loadingform.Label4.Text = "leaders" loadingform.Timer1.Enabled = True loadingform.Timer1.Start() End Sub Private Sub alvarhhl() Dim querry As String = "SELECT COUNT(*) FROM hhl where barangay = 'ALVAR' " Using conn As New MySqlConnection(connStrr) Using cmd As New MySqlCommand() With cmd .Connection = conn .CommandText = querry .CommandType = CommandType.Text End With Try conn.Open() Dim count As Int16 = Convert.ToInt16(cmd.ExecuteScalar()) If CheckBox1.Checked = True Then Label4.Text = Label4.Text + count Else Label4.Text = Label4.Text - count End If 'Label2.Text = count 'Label14.Text = count ' MsgBox(count.ToString()) conn1.Close() remainalvar() Catch ex As Exception MsgBox(ex.Message) End Try End Using End Using 'Try ' Dim table As New DataTable() ' conns() ' Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'ALVAR' ", conn1) ' adapter.Fill(table) ' pagingDS2 = New DataSet() ' adapter.Fill(pagingDS2, "hhl_table") ' sRecord_Count = pagingDS2.Tables(0).Rows.Count ' Dim lst = (From row In table.AsEnumerable ' Select row.Field(Of String)(0)).Count ' Dim counthhl As Double ' counthhl = lst ' If CheckBox1.Checked = True Then ' Label4.Text = Label4.Text + counthhl ' Else ' Label4.Text = Label4.Text - counthhl ' End If ' remainalvar() ' conn1.Close() ' conn1.Dispose() 'Catch ex As Exception ' MsgBox(ex.Message) 'Finally 'End Try CANINGAGhhl() End Sub Private Sub CANINGAGhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'CANINGAG' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label9.Text = Label9.Text + counthhl Else Label9.Text = Label9.Text - counthhl End If remainCANINGAG() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try BALANTEhhl() End Sub Private Sub BALANTEhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'D.L. BALANTE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label13.Text = Label13.Text + counthhl Else Label13.Text = Label13.Text - counthhl End If remainBALANTE() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try LAMIAWANhhl() End Sub Private Sub LAMIAWANhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'LAMIAWAN' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label17.Text = Label17.Text + counthhl Else Label17.Text = Label17.Text - counthhl End If remainLAMIAWAN() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MANORIGAOhhl() End Sub Private Sub MANORIGAOhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'MANORIGAO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label21.Text = Label21.Text + counthhl Else Label21.Text = Label21.Text - counthhl End If remainMANORIGAO() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MERCEDEShhl() End Sub Private Sub MERCEDEShhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'MERCEDES' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label25.Text = Label25.Text + counthhl Else Label25.Text = Label25.Text - counthhl End If remainMERCEDES() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PALMAGILhhl() End Sub Private Sub PALMAGILhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'PALMA GIL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label29.Text = Label29.Text + counthhl Else Label29.Text = Label29.Text - counthhl End If remainPALMAGIL() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PICHONhhl() End Sub Private Sub PICHONhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'PICHON' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label33.Text = Label33.Text + counthhl Else Label33.Text = Label33.Text - counthhl End If remainPICHON() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SOBRECAREYhhl() End Sub Private Sub SOBRECAREYhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'P.M. SOBRECAREY' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label37.Text = Label37.Text + counthhl Else Label37.Text = Label37.Text - counthhl End If remainSOBRECAREY() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try POBLACIONhhl() End Sub Private Sub POBLACIONhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'POBLACION' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label41.Text = Label41.Text + counthhl Else Label41.Text = Label41.Text - counthhl End If remainPOBLACION() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANANTONIOhhl() End Sub Private Sub SANANTONIOhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SAN ANTONIO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label45.Text = Label45.Text + counthhl Else Label45.Text = Label45.Text - counthhl End If remainSANANTONIO() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANJOSEhhl() End Sub Private Sub SANJOSEhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SAN JOSE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label49.Text = Label49.Text + counthhl Else Label49.Text = Label49.Text - counthhl End If remainSANJOSE() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANLUIShhl() End Sub Private Sub SANLUIShhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SAN LUIS' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label85.Text = Label85.Text + counthhl Else Label85.Text = Label85.Text - counthhl End If remainSANLUIS() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANMIGUELhhl() End Sub Private Sub SANMIGUELhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SAN MIGUEL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label53.Text = Label53.Text + counthhl Else Label53.Text = Label53.Text - counthhl End If remainSANMIGUEL() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANPEDROhhl() End Sub Private Sub SANPEDROhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SAN PEDRO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label57.Text = Label57.Text + counthhl Else Label57.Text = Label57.Text - counthhl End If remainSANPEDRO() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANTIAGOhhl() End Sub Private Sub SANTIAGOhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'SANTIAGO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label61.Text = Label61.Text + counthhl Else Label61.Text = Label61.Text - counthhl End If remainSANTIAGO() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try STAFEhhl() End Sub Private Sub STAFEhhl() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM hhl where barangay LIKE 'STA. FE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "hhl_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label65.Text = Label65.Text + counthhl Else Label65.Text = Label65.Text - counthhl End If remainSTAFE() conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try totalpercentrec() End Sub '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== '==================================================================== Sub alvarpco() 'Try Dim querry As String = "SELECT COUNT(*) FROM pco where barangay = 'ALVAR' " Using conn As New MySqlConnection(connStrr) Using cmd As New MySqlCommand() With cmd .Connection = conn .CommandText = querry .CommandType = CommandType.Text End With Try conn.Open() Dim count As Int16 = Convert.ToInt16(cmd.ExecuteScalar()) If CheckBox1.Checked = True Then Label4.Text = Label4.Text + count Else Label4.Text = Label4.Text - count End If 'Label2.Text = count 'Label14.Text = count ' MsgBox(count.ToString()) conn1.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Using End Using ' Dim table As New DataTable() ' conns() ' Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'ALVAR' ", conn1) ' adapter.Fill(table) ' pagingDS2 = New DataSet() ' adapter.Fill(pagingDS2, "pco_table") ' sRecord_Count = pagingDS2.Tables(0).Rows.Count ' Dim lst = (From row In table.AsEnumerable ' Select row.Field(Of String)(0)).Count ' Dim counthhl As Double ' counthhl = lst ' If CheckBox1.Checked = True Then ' Label4.Text = Label4.Text + counthhl ' Else ' Label4.Text = Label4.Text - counthhl ' End If ' conn1.Close() ' conn1.Dispose() 'Catch ex As Exception ' MsgBox(ex.Message) 'Finally 'End Try CANINGAGpco() End Sub Private Sub CANINGAGpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'CANINGAG' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label9.Text = Label9.Text + counthhl Else Label9.Text = Label9.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try BALANTEpco() End Sub Private Sub BALANTEpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'D.L. BALANTE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label13.Text = Label13.Text + counthhl Else Label13.Text = Label13.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try LAMIAWANpco() End Sub Private Sub LAMIAWANpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'LAMIAWAN' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label17.Text = Label17.Text + counthhl Else Label17.Text = Label17.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MANORIGAOpco() End Sub Private Sub MANORIGAOpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'MANORIGAO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label21.Text = Label21.Text + counthhl Else Label21.Text = Label21.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MERCEDESpco() End Sub Private Sub MERCEDESpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'MERCEDES' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label25.Text = Label25.Text + counthhl Else Label25.Text = Label25.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PALMAGILpco() End Sub Private Sub PALMAGILpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'PALMA GIL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label29.Text = Label29.Text + counthhl Else Label29.Text = Label29.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PICHONpco() End Sub Private Sub PICHONpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'PICHON' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label33.Text = Label33.Text + counthhl Else Label33.Text = Label33.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SOBRECAREYpco() End Sub Private Sub SOBRECAREYpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'P.M. SOBRECAREY' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label37.Text = Label37.Text + counthhl Else Label37.Text = Label37.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try POBLACIONpco() End Sub Private Sub POBLACIONpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'POBLACION' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label41.Text = Label41.Text + counthhl Else Label41.Text = Label41.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANANTONIOpco() End Sub Private Sub SANANTONIOpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SAN ANTONIO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label45.Text = Label45.Text + counthhl Else Label45.Text = Label45.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANJOSEpco() End Sub Private Sub SANJOSEpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SAN JOSE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label49.Text = Label49.Text + counthhl Else Label49.Text = Label49.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANLUISpco() End Sub Private Sub SANLUISpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SAN LUIS' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label85.Text = Label85.Text + counthhl Else Label85.Text = Label85.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANMIGUELpco() End Sub Private Sub SANMIGUELpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SAN MIGUEL' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label53.Text = Label53.Text + counthhl Else Label53.Text = Label53.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANPEDROpco() End Sub Private Sub SANPEDROpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SAN PEDRO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label57.Text = Label57.Text + counthhl Else Label57.Text = Label57.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANTIAGOpco() End Sub Private Sub SANTIAGOpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'SANTIAGO' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label61.Text = Label61.Text + counthhl Else Label61.Text = Label61.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try STAFEpco() End Sub Private Sub STAFEpco() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM pco where barangay LIKE 'STA. FE' ", conn1) adapter.Fill(table) pagingDS2 = New DataSet() adapter.Fill(pagingDS2, "pco_table") sRecord_Count = pagingDS2.Tables(0).Rows.Count Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label65.Text = Label65.Text + counthhl Else Label65.Text = Label65.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try alvarbcc() End Sub '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== '====================================================================== 'BCC Private Sub alvarbcc() Dim querry As String = "SELECT COUNT(*) FROM bcc where barangay = 'ALVAR' " Using conn As New MySqlConnection(connStrr) Using cmd As New MySqlCommand() With cmd .Connection = conn .CommandText = querry .CommandType = CommandType.Text End With Try conn.Open() Dim count As Int16 = Convert.ToInt16(cmd.ExecuteScalar()) If CheckBox1.Checked = True Then Label4.Text = Label4.Text + count Else Label4.Text = Label4.Text - count End If 'Label2.Text = count 'Label14.Text = count ' MsgBox(count.ToString()) conn1.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Using End Using 'Try ' Dim table As New DataTable() ' conns() ' Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'ALVAR' ", conn1) ' adapter.Fill(table) ' Dim lst = (From row In table.AsEnumerable ' Select row.Field(Of String)(0)).Count ' Dim counthhl As Double ' counthhl = lst ' If CheckBox1.Checked = True Then ' Label4.Text = Label4.Text + counthhl ' Else ' Label4.Text = Label4.Text - counthhl ' End If ' conn1.Close() ' conn1.Dispose() 'Catch ex As Exception ' MsgBox(ex.Message) 'Finally 'End Try CANINGAGbcc() End Sub Private Sub CANINGAGbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'CANINGAG' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label9.Text = Label9.Text + counthhl Else Label9.Text = Label9.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try BALANTEbcc() End Sub Private Sub BALANTEbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'D.L. BALANTE' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label13.Text = Label13.Text + counthhl Else Label13.Text = Label13.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try LAMIAWANbcc() End Sub Private Sub LAMIAWANbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'LAMIAWAN' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label17.Text = Label17.Text + counthhl Else Label17.Text = Label17.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MANORIGAObcc() End Sub Private Sub MANORIGAObcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'MANORIGAO' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label21.Text = Label21.Text + counthhl Else Label21.Text = Label21.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try MERCEDESbcc() End Sub Private Sub MERCEDESbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'MERCEDES' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label25.Text = Label25.Text + counthhl Else Label25.Text = Label25.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PALMAGILbcc() End Sub Private Sub PALMAGILbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'PALMA GIL' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label29.Text = Label29.Text + counthhl Else Label29.Text = Label29.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try PICHONbcc() End Sub Private Sub PICHONbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'PICHON' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label33.Text = Label33.Text + counthhl Else Label33.Text = Label33.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SOBRECAREYbcc() End Sub Private Sub SOBRECAREYbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'P.M. SOBRECAREY' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label37.Text = Label37.Text + counthhl Else Label37.Text = Label37.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try POBLACIONbcc() End Sub Private Sub POBLACIONbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'POBLACION' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label41.Text = Label41.Text + counthhl Else Label41.Text = Label41.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANANTONIObcc() End Sub Private Sub SANANTONIObcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SAN ANTONIO' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label45.Text = Label45.Text + counthhl Else Label45.Text = Label45.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANJOSEbcc() End Sub Private Sub SANJOSEbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SAN JOSE' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label49.Text = Label49.Text + counthhl Else Label49.Text = Label49.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANLUISbcc() End Sub Private Sub SANLUISbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SAN LUIS' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label85.Text = Label85.Text + counthhl Else Label85.Text = Label85.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANMIGUELbcc() End Sub Private Sub SANMIGUELbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SAN MIGUEL' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label53.Text = Label53.Text + counthhl Else Label53.Text = Label53.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANPEDRObcc() End Sub Private Sub SANPEDRObcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SAN PEDRO' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label57.Text = Label57.Text + counthhl Else Label57.Text = Label57.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try SANTIAGObcc() End Sub Private Sub SANTIAGObcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'SANTIAGO' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label61.Text = Label61.Text + counthhl Else Label61.Text = Label61.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try STAFEbcc() End Sub Private Sub STAFEbcc() Try Dim table As New DataTable() conns() Dim adapter As New MySqlDataAdapter("SELECT names FROM bcc where barangay LIKE 'STA. FE' ", conn1) adapter.Fill(table) Dim lst = (From row In table.AsEnumerable Select row.Field(Of String)(0)).Count Dim counthhl As Double counthhl = lst If CheckBox1.Checked = True Then Label65.Text = Label65.Text + counthhl Else Label65.Text = Label65.Text - counthhl End If conn1.Close() conn1.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try alvarhhl() End Sub End Class