troubleshooting Question

How to set a selecting parameter for an ObjectDataSource

Avatar of Scarlett72
Scarlett72 asked on
C#ASP.NET.NET Programming
3 Comments1 Solution424 ViewsLast Modified:
Hi I want to pass a parameter to a dataset in a typed dataset .xsd tableadapter.  So when a user clicks on the button named 'Add' they will see the data associated with 'Add' and when they click on the button named 'Remove' they will see the data associated with 'Remove'  

 <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="RapidFire.RFTableAdapters.USP_RD_UPSELL_CALCTableAdapter" OnSelecting="ObjectDataSource2_Selecting">
                <asp:Parameter Name="action" ConvertEmptyStringToNull="true" Type="String" />
So I think I'm supposed to create a 'Selecting' event and do something like this:

protected void ObjectDataSource2_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
            e.InputParameters[""] = "Add";

I'm not really sure how to apply logic so when a user presses the add or remove button they are going to get the appropriate data ... any point in the right direction would really be appreciated!
Kyle Abrahams
Director of Information Technology

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros