Trying to combine Dynamic Data, Linq, and stored procedures - no luck RRS feed

  • Question

  • User-1961942910 posted

    I'm using Dynamic Data 3.5 SP1.

    Basically, I want the usual ListDetails.aspx functionality provided with Dynamic Data - some filters, a gridview, and a details view.

    In this case, I want to add a text box where the user can input a search string.  I then need to call a stored procedure that returns the results to Linq to populate the grid and details view. The stored procedure handles searching through multiple columns of the table.

    I've looked at all the articles on using stored procedures with LINQ, and I've got my TextBox1, a Button1 called GO, and the OnSelecting code, like this:

    protected void ClientsDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
            MyDataContext dc = new MyDataContext();
            e.Result = dc.spSearchClients2(TextBox1.Text);


    This loads up the grid nicely the first time the page loads, but I can't get it to reload when the Go button is clicked.  Is there some other method I have to invoke to force the Selecting event to fire again, and use the new value of TextBox1?


    Thursday, August 21, 2008 7:20 PM

All replies

  • User1641955678 posted

    You can call DataBind() on the GridView to force it to rebind.  That should cause the Select to execute again.


    Friday, August 22, 2008 1:56 AM