Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub pdelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pdelete.Click
- connect = New OdbcConnection("driver=MySQL ODBC 5.2 ANSI Driver;localhost;port=3306;uid='root';pwd=;database=enrollment")
- connect.Open()
- If cbprof.Text = "" Then
- MessageBox.Show("Please fill up the form", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning)
- Else
- Dim myConnection As OleDbConnection = New OleDbConnection
- Dim okToDelete As MsgBoxResult = MsgBox("Are you sure you want to delete?", MsgBoxStyle.YesNo)
- If okToDelete = MsgBoxResult.Yes Then
- End If
- Dim ID As String
- Dim time As String
- Dim subjects As String
- Dim room_number As String
- Dim days As String
- Dim building_number As String
- Dim grade As String
- Dim section As String
- Dim semester As String
- Dim professor As String
- ID = txtid.Text.ToUpper.Trim
- time = cbtime.Text.ToUpper.Trim
- subjects = cbsubj.Text.ToUpper.Trim
- room_number = cbroom.Text.ToUpper.Trim
- days = cbday.Text.ToUpper.Trim
- building_number = cbbldg.Text.ToUpper.Trim
- grade = cbgrade.Text.ToUpper.Trim
- section = cbsec.Text.ToUpper.Trim
- semester = cbsem.Text.ToUpper.Trim
- professor = cbprof.Text.ToUpper.Trim()
- connectMe()
- With myCmd
- .Connection = Con
- .CommandText = " delete from class_scheduler where ID = '" & ID & "'"
- .ExecuteNonQuery()
- End With
- txtid.Enabled = False
- cbtime.Enabled = True
- cbsubj.Enabled = True
- cbroom.Enabled = True
- cbday.Enabled = True
- cbbldg.Enabled = True
- cbgrade.Enabled = True
- cbsec.Enabled = True
- cbsem.Enabled = True
- cbprof.Enabled = True
- cbprof.Focus()
- MessageBox.Show(" Successfully deleted.")
- txtid.Clear()
- cbtime.Text = String.Empty
- cbsubj.Text = String.Empty
- cbroom.Text = String.Empty
- cbday.Text = String.Empty
- cbbldg.Text = String.Empty
- cbgrade.Text = String.Empty
- cbsec.Text = String.Empty
- cbsem.Text = String.Empty
- cbprof.Text = String.Empty
- cbprof.Focus()
- Me.refreshMe()
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement