Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 589
  • Last Modified:

asp.net updatepanel update sqldatasource

I have  a grid in an updatepanel that is bound to a sql datasource.

The sql datasource uses a stored procedure and I have the parameter value coming from a text field.

when the user clicks on a button I want to have the sql data source to update

How do I do this




<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="usp_Admin_GetAll" 
        SelectCommandType="StoredProcedure" 
        ProviderName="<%$ ConnectionStrings:on.ProviderName %>">
        <SelectParameters>
            <asp:FormParameter DefaultValue="%" FormField="txtSearch" Name="txt" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

Open in new window

0
JonMny
Asked:
JonMny
  • 2
1 Solution
 
David RobitailleAnalyst ProgrammerCommented:
it<s the grid the should be in the update panel.
click event of the button, do a grid.DataBind(), that will update the data source.
0
 
David RobitailleAnalyst ProgrammerCommented:
So, did that work?
0
 
JonMnyAuthor Commented:
That worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now