Dropdownlist Cache
-
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)
-
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)
You have to bind the dropDown list again with the data source after u deleted the record from Database .
-
You have to bind the dropDown list again with the data source after u deleted the record from Database .