Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When does datasource reissue a select
Message
From
19/06/2008 16:00:10
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
When does datasource reissue a select
Miscellaneous
Thread ID:
01325539
Message ID:
01325539
Views:
68
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
Next
Reply
Map
View

Click here to load this message in the networking platform