Tuesday, May 11, 2021

Persons Address Book in Visual Basic .NET And Microsoft Access

A simple Persons Address Book in Visual Basic .NET  And Microsoft Access database applications that I wrote while I am learning database programming in Visual Basic NET.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com











Complete Program Listing of Persons Address Book in Microsoft Visual Basic .NET, and Microsoft Access

 

Imports System.Data.OleDb

Imports System.IO

 

Public Class Form1

 

    Dim strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=addressbook.accdb;Persist Security Info=False;"

    Dim con As New OleDbConnection

    Dim cmd As New OleDbCommand

    Dim da As New OleDbDataAdapter

    Dim dt As New DataTable

    Dim save_tag As String

 

    Sub Fill_Grid(grid As Windows.Forms.DataGridView)

        Dim x As Integer

 

        If grid.Rows.Count > 0 Then

            While x < grid.Rows.Count

                grid.Rows.RemoveAt(x)

            End While

        End If

 

        With grid

            .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill

            .RowHeadersVisible = False

            .SelectionMode = DataGridViewSelectionMode.FullRowSelect

        End With

 

        con.ConnectionString = strConn

        con.Open()

 

        With cmd

            .Connection = con

            .CommandType = CommandType.Text

            .CommandText = "SELECT * FROM addressbook"

        End With

        da.SelectCommand = cmd

        grid.DataSource = dt

        da.Fill(dt)

 

        For i As Integer = 0 To 0

            grid.Columns(i).Visible = False

        Next

        grid.Columns(0).Visible = False

 

        con.Dispose()

        con.Close()

 

    End Sub

    Sub save(ByVal tag As String)

 

        Dim cmdtxt As String = Nothing

        If tag = "new" Then

            cmdtxt = "INSERT INTO addressbook ([personsname], [address], [telephone], [mobile], [email]) " & _

                     "Values('" & UCase(TextBox1.Text) & "','" & UCase(TextBox2.Text) & "','" & UCase(TextBox3.Text) & "','" & UCase(TextBox4.Text) & "','" & LCase(TextBox5.Text) & "' ) "

 

        ElseIf tag = "edit" Then

            cmdtxt = "UPDATE addressbook SET " & _

                     "[personsname] = '" & UCase(TextBox1.Text.ToString) & "',[address] = '" & UCase(TextBox2.Text) & "', [telephone] = '" & UCase(TextBox3.Text) & "' , [mobile] ='" & UCase(TextBox4.Text) & "' ,[email]='" & LCase(TextBox5.Text) & "' " & _

                     "WHERE ID = " & TextBox6.Text & ""

        End If

 

        Try

 

            con.ConnectionString = strConn

            con.Open()

 

            With cmd

                .Connection = con

                .CommandType = CommandType.Text

                .CommandText = cmdtxt

            End With

 

            cmd.ExecuteNonQuery()

 

        Catch ex As Exception

            MsgBox(ex.Message, vbCritical)

        Finally

            con.Dispose()

            con.Close()

        End Try

    End Sub

 

    Sub delete(ByVal id As Integer)

        Dim cmdtxt As String = Nothing

 

        cmdtxt = "DELETE FROM addressbook WHERE ID = " & id & ""

 

        Try

            con.ConnectionString = strConn

            con.Open()

 

            With cmd

                .Connection = con

                .CommandType = CommandType.Text

                .CommandText = cmdtxt

            End With

 

            cmd.ExecuteNonQuery()

 

        Catch ex As Exception

            MsgBox(ex.Message, vbCritical)

        Finally

            con.Dispose()

            con.Close()

        End Try

    End Sub

 

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        TextBox6.Visible = False

        save_tag = "new"

        Fill_Grid(DataGridView1)

    End Sub

 

    ' New Button

    ' To clear the text box which allows the user to type new record

 

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        TextBox1.Text = String.Empty

        TextBox2.Text = String.Empty

        TextBox3.Text = String.Empty

        TextBox4.Text = String.Empty

        TextBox5.Text = String.Empty

        TextBox1.Focus()

 

        save_tag = "new"

    End Sub

 

 

    ' Save Button

    ' This button will allow that user to save the new or updated records in

    ' the Microsoft Access database.

 

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        save(save_tag)

        Button1.PerformClick()

        Fill_Grid(DataGridView1)

 

    End Sub

 

    ' Delete Button

    ' This button will allows the user to remove a particular record from the database in Microsoft Access.

 

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

        Dim id As Integer

        id = Val(TextBox6.Text)

        delete(id)

        Button1.PerformClick()

        Fill_Grid(DataGridView1)

    End Sub

 

    Private Sub DataGridView1_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick

        TextBox1.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value.ToString

        TextBox2.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString

        TextBox3.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value.ToString

        TextBox4.Text = DataGridView1.Rows(e.RowIndex).Cells(4).Value.ToString

        TextBox5.Text = DataGridView1.Rows(e.RowIndex).Cells(5).Value.ToString

        TextBox6.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value.ToString

 

        save_tag = "edit"

 

    End Sub

 

    ' Cancel Button

    ' The cancel button which allows the user to cancel the operation

    ' and return to the main menu of Persons Address Book.

 

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

        Button1.PerformClick()

    End Sub

    ' Close Button

    ' This button will allow the user to close the program and return to the windows operating system.

 

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

        If MsgBox("Are you sure you want to quit?", MsgBoxStyle.YesNo Or MsgBoxStyle.DefaultButton2, "Close application") = Windows.Forms.DialogResult.Yes Then

            Me.Close()

        End If

        TextBox1.Focus()

    End Sub

End Class

 

DOWNLOAD THE COMPLETE SOURCE CODE HERE

Monday, May 10, 2021

Hello World in Dart

Hello World in Dart

 I simple hello world program that I wrote using Dart programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com






Program Listing


hello_world.dart


void main() {
  print("Hello World in Dart.");
 }


Sunday, May 9, 2021

Login and Registration System VBNET and MS Access

Login and Registration System in VB.NET and Microsoft Access

 In the tutorial, I will show you how to create a login and registration system using Microsoft Visual Basic NET and Microsoft Access.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com










Download the Complete Source Code Here

Saturday, May 8, 2021

Alphabet Checker in Java

Alphabet Checker in Java

 In this tutorial, I will show you guys how to create a Java program to ask the user to give a character, and then the program will check if the given character is an alphabet or not.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com






Program Listing

/**

 * @author Jake Rodriguez Pomperada,MAED-IT, MIT

 * www.jakerpomperada.com    www.jakerpompomperada.blogspot.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 *

 */

import java.util.Scanner;


public class Alphabet_Checker {


/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner scan = new Scanner(System.in);

    

  System.out.println();

  System.out.println("===== Alphabet Checker  in Java =====");

  System.out.println();

  System.out.print("Give a Alphabet : ");

  char char_given = scan.next().charAt(0);

  

  System.out.println();

    // checks if char_giv  is an alphabet

    if (Character.isAlphabetic(char_given)) {

      System.out.println("The given " + char_given  + " is an alphabet.");

    }

    else { 

      System.out.println("The given " + char_given + " is not an alphabet.");

    }

      System.out.println();

  System.out.println("=====   END OF PROGRAM =====");

  System.out.println();

}


}


Friday, May 7, 2021

Addition of Two Numbers in Dart

Addition of Two Numbers in Dart

 In this tutorial, I will teach you how to write a simple addition of two numbers using Dart programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com





Program Listing

/* addition.dart
   Jake Rodriguez Pomperada, MAED-IT, MIT
   www.jakerpomperada.com   www.jakerpomperada.blogspot.com
   jakerpomperada@gmail.com
   Bacolod City, Negros Occidental Philippnes
*/
import 'dart:io';

void main() {
  stdout.write("\n");
  print("\tAddition of Two Numbers in Dart\n");

  stdout.write("Give First Value  : ");
  var input1 = stdin.readLineSync();

  stdout.write("Give Second Value : ");
  var input2 = stdin.readLineSync();
  stdout.write("\n");

  if (input1 != null && input2 != null) {
    var number1 = int.parse(input1);
    var number2 = int.parse(input2);

    var sum = (number1 + number2);
    print("The sum of $number1 and $number2 is $sum.\n");
  }

  print("\tEnd of Program\n");
}


Thursday, May 6, 2021

Feet To Inch Conversion in Java

Feet To Inch Conversion in Java

 In this tutorial, I will show you how to create a menu-driven program to convert feet to the inch and vice versa using Java programming language. I hope you will like my program.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com






Program Listing


/**

 * @author Jake Rodriguez Pomperada,MAED-IT, MIT

 * www.jakerpomperada.com    www.jakerpompomperada.blogspot.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 *

 */

import java.util.Scanner;

import java.math.RoundingMode;

import java.text.DecimalFormat;


public class Feet_Inch {


/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

  Scanner scan = new Scanner(System.in);

  DecimalFormat df = new DecimalFormat("#.##");

      df.setRoundingMode(RoundingMode.CEILING);

  

      System.out.println();

  System.out.println("===== Feet To Inch Conversion in Java =====");

  System.out.println();

  System.out.println("[1] Feet to Inch Conversion");

  System.out.println("[2] Inch To Feet Conversion");

  System.out.println();

  System.out.print("Selection your option : ");

  int ch= scan.nextInt();

  

  if (ch==1) 

  {

   System.out.println();

   System.out.print("Give Feet Value : ");

   double feet = scan.nextDouble();

   double inch = feet*12;

   System.out.println();

   System.out.println("The feet(s) equivalues is  "+df.format(inch));

  }

   

  else if (ch==2) 

  {

   System.out.println();

   System.out.print("Give Inch Value : ");

   double inch = scan.nextDouble();

   double feet= inch/12;

   System.out.println();

   System.out.println("The feet(s) equivalues is  "+df.format(feet));

  }

   

  else

  {

   System.out.println("Invalid Option. Please Try Again.");

  }

  System.out.println();

  System.out.println("=====   END OF PROGRAM =====");

  System.out.println();

}


}



Wednesday, May 5, 2021

Count Vowels , Consonants, and Digits in C

Count Vowels, Consonants, and Digits in C

 In this tutorial our program will count the number of vowels, consonants, and digits using C programming language. I hope you will find my  work useful.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com





Program Listing

/* vowels_consonants.c

   Author : Jake Rodriguez Pomperada, MAED-IT, MIT

   www.jakerpomperada.com   www.jakerpomperada.blogspot.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental Philippines

*/


#include <stdio.h>

#include <assert.h>

#include <stdbool.h>

#include <ctype.h>

#include <string.h>


typedef struct

{

int vowel_count;

int consonant_count;

int digit_count;

}Stat;


bool is_vowel(char ch)

{

const char vowels[] = "aeiou";


return strchr(vowels, tolower(ch)) != NULL;

}


bool is_consonant(char ch)

{

const char consonants[] = "bcdfghjklmnpqrstuvwxyz";


return strchr(consonants, tolower(ch)) != NULL;

}


void do_stats(const char* txt, size_t size, Stat *stat)

{

assert(txt != NULL && size > 1);

assert(stat != NULL);


const char *cp = txt;


while (size--)

{

if (is_vowel(*cp))

stat->vowel_count++;

else if (is_consonant(*cp))

stat->consonant_count++;

else if (isdigit(*cp))

stat->digit_count++;

cp++;

}

}


void print_stats(const Stat* stat)

{

assert(stat != NULL);


printf("\tStatistics:\n");

printf("\t===========\n");

printf("\t  Vowels    : %d\n", stat->vowel_count-1);

printf("\t  Consonants: %d\n", stat->consonant_count);

printf("\t  Digits    : %d\n", stat->digit_count);

}


int main()

{

Stat stat = {0,0,0};

printf("\n\n");

printf("\tCount Vowels,Consonants, and Digits in C");

printf("\n\n");

const char input[] = "Jake Pomperada, 42 years old and 173 cm tall.";

printf("\t%s", input);

printf("\n\n");

do_stats(input, sizeof(input), &stat);

print_stats(&stat);

printf("\n\n");

system("pause");

}



Sunday, May 2, 2021

Addition of Three Numbers in Java

Addition of Three Numbers in Java

 

Write a program in Java that will ask the user to input three numbers and then the program will find the total sum of three numbers given by our user.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com






Program Listing


addition_of_three_numbers.java

/**

 * @author Jake Rodriguez Pomperada,MAED-IT, MIT

 * www.jakerpomperada.com    www.jakerpompomperada.blogspot.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 *

 */

import java.util.Scanner;


public class addition_of_three_numbers {


/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner scan = new Scanner(System.in);

  System.out.println();

  System.out.println("===== Addition of Three Numbers in Java =====");

  System.out.println();

  System.out.print("Enter First Number : ");

  int a = scan.nextInt();

  System.out.print("Enter Second Number : ");

  int b = scan.nextInt();

  System.out.print("Enter Third Number : ");

  int c = scan.nextInt();

  int sum = (a+b+c);

  System.out.println();

  System.out.print("The sum of "+ a  + " , " + b + " and " 

  + c + " is " + sum + ".");

  System.out.println("\n\n");

  System.out.println("=====   END OF PROGRAM =====");

  System.out.println();

}


}


Simple Distance Converter in PHP

Multi Line Message Box in VB NET