Protected Sub cmdAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdAdd.Click Dim sql As String = "INSERT into list_members (list_ID, personID) VALUES " sql += "(" & Session("CurrentList").ToString & "," & ListBox2.SelectedValue.ToString & ")" SqlDataSource3.InsertCommand = sql SqlDataSource3.Insert() SqlDataSource3.Select(DataSourceSelectArguments.Empty) ListBox3.DataBind() lblOwner.Text = sql End Subbut I still don't see the new data unless I move to a different page and then come back.
>> Protected Sub cmdAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdAdd.Click >> Dim sql As String = "INSERT into list_members (list_ID, personID) VALUES " >> sql += "(" & Session("CurrentList").ToString & "," & ListBox2.SelectedValue.ToString & ")" >> SqlDataSource3.InsertCommand = sql >> SqlDataSource3.Insert() >> SqlDataSource3.Select() ' This line presents an error and may not belong >> ListBox3.DataBind() >> End Sub >>>>