Learn Computer Programming Free from our source codes in my website.
Sponsored Link Please Support
https://www.techseries.dev/a/27966/qWm8FwLb
https://www.techseries.dev/a/19181/qWm8FwLb
My Personal Website is http://www.jakerpomperada.com
Email me at jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Thursday, May 13, 2021
Addition of Two Numbers in Julia
In this tutorial, I will share with you how to write a program that will ask the user to give two numbers, and then the program will compute the sum of the two given numbers using Julia programming language.
My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Program Listing
Wednesday, May 12, 2021
Add, Find, and Count Words in Microsoft Visual Basic NET
A simple program that I wrote in Microsoft Visual Basic NET to count, add, and find words in the text box I hope you will find my work useful.
My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Program Listing
' Created By Mr. Jake Rodriguez Pomperada, MAED-IT, MIT
' www.jakerpomperada.com and www.jakerpomperada.blogspot.com
' jakerpomperada@gmail.com
' Bacolod City, Negros Occidental Philippines
Public Class Form1
Function wordCount(ByVal str As String)
Dim NumberOfWord As Integer
NumberOfWord = UBound(Split(Trim(Replace(str, Space(2), Space(1))))) + 1
Return NumberOfWord
End Function
Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged
If RichTextBox1.Text.ToLower = "" Then
TextBox1.Text = "0"
Else
TextBox1.Text = wordCount(RichTextBox1.Text.ToLower)
End If
End Sub
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim str_input As String
str_input = (TextBox2.Text.ToLower)
RichTextBox1.AppendText(str_input + " ")
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim text1 As String
text1 = (RichTextBox1.Text)
Dim mysplit As Array
mysplit = Split(text1, TextBox3.Text)
Dim count As Integer
count = mysplit.Length - 1
Label4.Text = "No. of Matches : " & count
Label5.Text = "Find Word : " & TextBox3.Text.ToUpper
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
TextBox2.Text = ""
TextBox3.Text = ""
RichTextBox1.Text = ""
Label4.Text = ""
Label5.Text = ""
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
MsgBox("Created By Mr. Jake Rodriguez Pomperada, MAED-IT, MIT " & vbCrLf _
& "www.jakerpomperada.com and www.jakerpomperada.com" & vbCrLf _
& "jakerpomperada@gmail.com", MsgBoxStyle.Information, "About this Program")
End Sub
End Class
DOWNLOAD THE COMPLETE SOURCE CODE HERE
Odd and Even Numbers in Julia
A simple program that I wrote to ask the user to give a number and then the program will check if the given number is an odd or even number.
My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Program Listing
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.
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