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 71217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:51:11+00:00 2026-05-10T19:51:11+00:00

I have code similar to the following in many places: var dbParams = db.ReadParams(memberID,

  • 0

I have code similar to the following in many places:

var dbParams = db.ReadParams(memberID, product, GetSubscriptionFields()); Debug.Assert(dbParams.Count == 4);  _memberCode = dbParams[0]; _password = dbParams[1]; _userName = dbParams[2]; _reasonCode = dbParams[3]; 

ReadParams() returns an array of strings, the number of strings depending on the GetSubscriptionFields() function. I could use dbParams[] directly in my code, but I find it more helpful to give meaningful names to each of the values in the array. Is there a way I can get all the results directly, without going through the array?

I am looking for something like:

db.ReadParams(memberID, product, out _memberCode, out _password, out _userName, out _reasonCode); 

or

Tuple<_memberCode, _password, _userName, _reasonCode> = db.ReadParams(memberID, product); 

Of course, it has to be legal C# code 🙂

  • 1 1 Answer
  • 3 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. 2026-05-10T19:51:12+00:00Added an answer on May 10, 2026 at 7:51 pm

    Why not use constants instead?

    Then in your code you could have

    dbParams[MEMBER_CODE] dbParams[PASSWORD] dbParams[USERNAME] dbParams[REASON_CODE] 

    which meets your goal of meaningful names without changing the way the method works.

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

Sidebar

Related Questions

I have the following code section, designed to count how many Excel processes are
I have the following code, i use v similar code on many pages but
I have code similar to the following with a URL like this... If I
In a CUDA kernel, I have code similar to the following. I am trying
I have code, similar to the following, that I would like to modify: Sub
I have an ASP.NET web site with something similar to the following code: .aspx
The following code returns the error from the For Each loop. I have similar
I have Perl code similar to the following: # -- start -- my $res;
I have code similar to: number_to_currency(line_item.price, :unit => £) littering my views in various
I have code similar to this: public List<string> Expected = new List<string>(); public int

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.