troubleshooting Question

Adding a Guid as a ObjectDataSource Parameter

Avatar of robaherne
robaherne asked on
.NET ProgrammingASP.NET
2 Comments1 Solution720 ViewsLast Modified:
I have an ObjectDataSource that uses a SelectMethod that requires a Guid. I can't seem to set the Parameter programmatically from the code behind. Please Help.

CODE:

//DATASOURCE OBJECT

<asp:ObjectDataSource ID="GigsDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetVenueAndGigDetails_ByVenueId" TypeName="VenueAndGigDetailsTableAdapters.DataTable1TableAdapter" OnSelected="GigsDataSource_Selected" >
       
        <SelectParameters>
        <asp:Parameter Name="VenueId" Type="Object" />
    </SelectParameters>
       
    </asp:ObjectDataSource>

// DataSources Selected Method

protected void GigsDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        e.OutputParameters["VenueId"] = new Guid("5a9669b1-62c6-4c98-ab58-d86d4df0222e");
    }
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
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 2 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