Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dropdownlist Cache

Dropdownlist Cache

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdatabasevisual-studiosecurity
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nour123
    wrote on last edited by
    #1

    Hi all I have a delete form, in this form i have a drop down that consists of users, all that I need is when the user clicks on the delete button, the selected user will be deleted, it works, but the deleted name is still in the list. How can I refresh the cache here is the code... Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim conn2 As New OleDbConnection conn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\WebSites\NandN\DB\nAndN.mdb;Persist Security Info=False" conn2.Open() Dim cm2 As New OleDb.OleDbCommand cm2.Connection = conn2 cm2.CommandText = "delete from news where n_id=" & DropDownList1.SelectedValue & " " cm2.ExecuteNonQuery() Response.Redirect("adminDeleteNews.aspx?flag=1") Button1.Enabled = False conn2.Close() cm2.Dispose() Catch ex As Exception Response.Write(Err.Description) End Try End Sub Regards.

    Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

    N 1 Reply Last reply
    0
    • N nour123

      Hi all I have a delete form, in this form i have a drop down that consists of users, all that I need is when the user clicks on the delete button, the selected user will be deleted, it works, but the deleted name is still in the list. How can I refresh the cache here is the code... Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim conn2 As New OleDbConnection conn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\WebSites\NandN\DB\nAndN.mdb;Persist Security Info=False" conn2.Open() Dim cm2 As New OleDb.OleDbCommand cm2.Connection = conn2 cm2.CommandText = "delete from news where n_id=" & DropDownList1.SelectedValue & " " cm2.ExecuteNonQuery() Response.Redirect("adminDeleteNews.aspx?flag=1") Button1.Enabled = False conn2.Close() cm2.Dispose() Catch ex As Exception Response.Write(Err.Description) End Try End Sub Regards.

      Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

      N Offline
      N Offline
      Nishant Singh
      wrote on last edited by
      #2

      You have to bind the dropDown list again with the data source after u deleted the record from Database .

      N 1 Reply Last reply
      0
      • N Nishant Singh

        You have to bind the dropDown list again with the data source after u deleted the record from Database .

        N Offline
        N Offline
        nour123
        wrote on last edited by
        #3

        it works thanks alot

        Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups