Monday, April 16, 2012
btnDelete for ClientServers
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim cmdStudent As New SqlCommand
Dim daStudent As New SqlDataAdapter
Dim dsStudent As New DataSet
Dim dtStudent As New DataTable
conn = GetConnect()
conn.Open()
cmdStudent = conn.CreateCommand
cmdStudent.CommandText = "Delete from UniversityStudent where Studentid = '" & Trim(txtSID.Text) & "'"
intcheck = cmdStudent.ExecuteReader.RecordsAffected
If intcheck > 0 Then
MsgBox("Record Deleted")
Else
MsgBox("No Records Deleted")
End If
conn.Close()
RefreshDataGrid()
End Sub
Subscribe to:
Post Comments (Atom)
"UPDATE universitystudent set StudentFirstName = '" & Trim(txtFirstName.Text) & "',StudentLastName = '" & Trim(txtLastName.Text) & "' WHERE StudentID = '" & Trim(txtStudentID.Text) & "'"
ReplyDelete