Hi Don,
On repost, the contents should automatically be OK assuming that the Insert was successful. Try trapping the results of the Insert to ensure that it's working.
>With a .NET webpage, if a SQLDatasource is updated programmatically, when does the SELECT become reexecuted? Say there is a button that inserts a new record. When the page reposts, the contents of the listbox remain unchanged. How do we reissue the SELECT so the contents of the listbox will be updated?
>
>
> 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
>
>
>
>Thanks
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05