Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:36:14+00:00 2026-06-02T05:36:14+00:00

Issue: I have 2 datasources declared on my .aspx file as shown below: <asp:ObjectDataSource

  • 0

Issue: I have 2 datasources declared on my .aspx file as shown below:

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="UsuarioDelete" SelectMethod="SelectMyAllNotME_Data" TypeName="BLLayer.Usuarios" OnInserted="ObjectDataSource_Inserted">
    <DeleteParameters>
        <asp:ControlParameter ControlID="ConfirmDialogBox1" Name="id_usuario" PropertyName="Aceptar_CommandName" Type="Int32" />
    </DeleteParameters>
    <SelectParameters>
        <asp:SessionParameter DefaultValue="1" Name="id_usuario" SessionField="id_usuario" Type="Int32" />
        <asp:SessionParameter DefaultValue="1" Name="id_pais" SessionField="id_pais" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DeleteMethod="UsuarioDelete" SelectMethod="SelectMyAllNotME_Data" TypeName="BLLayer.Usuarios" OnInserted="ObjectDataSource_Inserted">
    <DeleteParameters>
        <asp:ControlParameter ControlID="ConfirmDialogBox1" Name="id_usuario" PropertyName="Aceptar_CommandName" Type="Int32" />
    </DeleteParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="id_emp" QueryStringField="id_emp" Type="Int32" />
        </SelectParameters>
</asp:ObjectDataSource>

The method “SelectMyAllNotME_Data” is an overloaded method that in one he receives 2 values and in the other just one value, it is used to filter the information.
What I want to do is than in my onLoadPage method is something like this:

if (Request.QueryString["id_emp"] != null)
    {
        GridViewUsers.DataSource = ObjectDataSource2.SelectMethod;
        GridViewUsers.DataMember = ObjectDataSource2.SelectMethod;
    }
    else
    {
        GridViewUsers.DataSource = ObjectDataSource1.SelectMethod;
        GridViewUsers.DataMember = ObjectDataSource1.SelectMethod;
    }
}

I’ve already tried this, but it isn’t working, can anyone help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:36:15+00:00Added an answer on June 2, 2026 at 5:36 am

    on the datasource in aspx just do

    EnablePaging="true"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Folks, My Issue Why is an HSQLDB file-based database I have pre-populated with a
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have the following issue: I have a splash like window coming with my
The issue I have is that I want to parse strings in order, so
Here's the issue: I have 2 data contexts that I would like to do
I have a problem and I will try to explain the issue: I have
A common issue I have is getting confused what $(this) is referring to. I
Here's the issue: I have a list of App names that I want to
After searching the other questions none have answered the specific issue I have. We
I've been reading similar questions to this issue and have been able to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.