PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/e_desk/deletemodules.aspx.vb

http://github.com/shafiqissani/eDesk-Systems
Visual Basic | 57 lines | 38 code | 15 blank | 4 comment | 0 complexity | 142568254dac9431c440d1f846bea927 MD5 | raw file
  1. Imports System.Data
  2. Imports System.Data.SqlClient
  3. Namespace e_desk
  4. Partial Class deletemodules
  5. Inherits System.Web.UI.Page
  6. #Region " Web Form Designer Generated Code "
  7. 'This call is required by the Web Form Designer.
  8. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  9. End Sub
  10. Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  11. 'CODEGEN: This method call is required by the Web Form Designer
  12. 'Do not modify it using the code editor.
  13. InitializeComponent()
  14. End Sub
  15. #End Region
  16. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  17. 'Put user code to initialize the page here
  18. If Not IsPostBack Then
  19. Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
  20. con.Open()
  21. Dim str As String
  22. str = "select modulecode from hdmodules"
  23. Dim cmd As SqlCommand = New SqlCommand(str, con)
  24. Dim dr As SqlDataReader
  25. dr = cmd.ExecuteReader()
  26. t5.DataSource = dr
  27. t5.DataBind()
  28. con.Close()
  29. End If
  30. End Sub
  31. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  32. Dim s8 As String = t5.SelectedItem.Value
  33. Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
  34. con.Open()
  35. Dim Str As String = "delete from hdmodules where modulecode='" + s8 + "'"
  36. Dim cmd As SqlCommand
  37. cmd = New SqlCommand(Str, con)
  38. cmd.ExecuteNonQuery()
  39. Response.Write(" Reocrd deleted")
  40. End Sub
  41. End Class
  42. End Namespace