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

  • SEARCH
  • Home
  • 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 8690251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:51:46+00:00 2026-06-12T23:51:46+00:00

List<DynamicBusinessObject> dbo = SearchController.Instance.GetSearchResultList(search, null, date, startRow – 1, ucDataPager1.PageSize, state); The above line

  • 0
 List<DynamicBusinessObject> dbo = SearchController.Instance.GetSearchResultList(search, null, "date", startRow - 1, ucDataPager1.PageSize, state);

The above line of code is calling the GetSearchResultList method which up until now had 5 arguments.

I added a 6th argument but wanted to make this argument optional so that all the other pages that call this function don’t need to be updated just yet.

So i changed the function to look like this:

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
    public List<DynamicBusinessObject> GetSearchResultList(Search search, List<CategoryAttribute> listCatAttrib, string sortBy, int startRow, int pageSize, [Optional, DefaultParameterValue("")] string state)
    {
        StorageQuery qry = new QrySearchResult(
            search.ID,
            (listCatAttrib != null && listCatAttrib.Count > 0) ? listCatAttrib[0].Attribute.ID : -1,
            (listCatAttrib != null && listCatAttrib.Count > 1) ? listCatAttrib[1].Attribute.ID : -1,
            (listCatAttrib != null && listCatAttrib.Count > 2) ? listCatAttrib[2].Attribute.ID : -1,
            1, sortBy, startRow, pageSize, state);
        List<DynamicBusinessObject> list = BusinessObject.Search(qry);
        return list;
    }

However, when i try to build, it gives me the error that GetSearchResultList has no overload method and takes 5 arguments.
I also tried doing string state = “” instead of using [Optional]

Anyone got any ideas why it’s complaining about me not passing 6 arguments when i make the call if the 6th argument is optional?

  • 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-12T23:51:47+00:00Added an answer on June 12, 2026 at 11:51 pm

    You should be able to use:

    ..., string state = "") {
    

    One possible issue is that your project is targeting an older version of .NET. Check the project properties to make sure it is pointing at the correct version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i have a chunk of code like this: public List<DynamicBusinessObject> GetSearchResultList(Search search, List<CategoryAttribute>
List<String> ll = new LinkedList<String>(String1,String2,...); I want something like above. Is the above line
List<Foo> results = null; results = this.getResults(); if (results == null || results.size() ==
List the shipping city and state for the order that had the longest shipping
List -MEDICAL STUDENT - YEAR 1 -MEDICAL STUDENT -MEDICAL STUDENT - YEAR 2 I
List<int> megalist; int boxId; boxId = ListofUniqueIDSpecificToDate.IndexOf(lstbox.SelectedIndex);<< this is wrong I'm trying to display
list of link. required when we click it changes its color i.e highlight active
List the SHORTEST POSSIBLE CODE (counting number of instructions) for making x, y, and
List<SelectListItem> items = new List<SelectListItem>(); if (a) { SelectListItem deliveryItem = new SelectListItem() {
List<CertMail> lsRecipetNumber = new List<CertMail>(); CertMail class is in data access layer which returns

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.