Solved

asp.net updatepanel  update sqldatasource

Posted on 2008-10-01
3
559 Views
Last Modified: 2012-06-27
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
Comment
Question by:JonMny
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
David Robitaille earned 500 total points
ID: 22617378
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
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22742887
So, did that work?
0
 
LVL 9

Author Closing Comment

by:JonMny
ID: 31502097
That worked
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question