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

Click here to load this message in the networking platform