0% found this document useful (0 votes)
45 views

develop Applications Mysql: Following Using

The document describes a patient symptoms input system created using MySQL as the backend database and Visual Basic as the frontend. Form1 allows input of patient name, phone number, and symptoms, and submission to the MySQL database. Form2 displays the patient entries from the database in a datagrid. The application was implemented successfully, allowing input submission and display of past patient records.

Uploaded by

85 Rohith Amrose
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

develop Applications Mysql: Following Using

The document describes a patient symptoms input system created using MySQL as the backend database and Visual Basic as the frontend. Form1 allows input of patient name, phone number, and symptoms, and submission to the MySQL database. Form2 displays the patient entries from the database in a datagrid. The application was implemented successfully, allowing input submission and display of past patient records.

Uploaded by

85 Rohith Amrose
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

10.

CASE STUDIES (APPLICATION DEVELOPMENT USING ORACLE/ MYSQL)

back end and Visual Basic as front end


Aim
Tool.
:Develop the following applications using mysql as a

TOPIC: Patient Symptoms input system

CODE:
Create Mysql database:

Create TABLE patient_entry(


namel varchar(20),
phonenumber bigint,
symptom varchar(30)

FORM1: Main form

Imports System.Data.SqiClient
Public Class Form1
Private Sub Submit_Click(sender As Object, e As EventArgs) Handles Submit.Click
NameTxt.Text = "Hello " & NameTxt.Text

Try
Dim phonenum1 As Integer = CInt(PhoneNurmberTxt.Text)

Catch ex As System.InvalidCastException
Message Box.Show("Only Numbers in Phone Number")
Application. Restart()
Catch ex As Exception
Message Box.Show("Unknown Error Occured")
Application.Restart()
End Try
Message Box.Show("Submitted")

Dim connection As SqIConnection


= New SqlConnection ("Data Source=SRIVATPC;Initial
Catalog-patient_details;integrated Security=True")
connection.Open()
"insert into patient_entry
Dim sql As String =

(@name1,@phonenumber1,@symptom1)" Dim cmd


=

(name1, phonenumber, symptom) values


New SqiCommand(sql, connection)
cmd.Parameters.AddWithValue("@name1", NameTxt.Text)
Dim phonenum As Integer = CInt(PhoneNumberTxt.Text)
cmd.Parameters.AddVWithValue("@phonenumber1", phonenum)
cmd.Parameters.AddWithValue("@symptom1", SymtomsTxt.Text)
cmd.ExecuteNonQuery(0
End Sub

Private Sub ResetClick(sender As Object, e As EventArgs) Handles Reset.Click


SymtomsTxt.Text ="
NameTxt.Text ="
PhoneNumberTxt. Text ="
End Sub
End Class
FORM2: Display Patient Form

Imports System.Data. SqlClient


Public Class Form2
Private Sub Form2 Load (sender As Object, e As EventArgs) Handles MyBase. Load Dim connection
As SqlConnection New SqlConnection ( "Data Source=SRIVATPC;
=
Initial1
Catalog=patient_details ; Integrated Security=True")
Dim cmd As SqlCommand- New SqlCommand ("select from patient_entry", connection) Dim a As
New SqlDataAdapter (cmd)
Dim dt As New DataTable
a. Fill(dt)
DataGridView1.DataSource = dt
End Sub
End Class

OUTPUT:

d Froemt

Patient Registration System

Name Stivathan6
Phcne Namber 9847825487

Synptoma old
Resat Subm

Show Pastients

Submitted

OK

Form2
name1 phoneumber symptomn
Srivathsan G 9847825487 cold

Result:
The Visual Basic Application with SQL as Backend has been implemented and executed successfully

You might also like