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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:00:23+00:00 2026-05-20T01:00:23+00:00

I am tempted to loop through the results and just add it to the

  • 0

I am tempted to loop through the results and just add it to the string array but I’m sure there must be a better way.

My sproc returns a ISingleResult<T> (where T is just a class with 1 string).

I want to return this list as a string[]. Is there any way to do this without using foreach loop?

  • 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-05-20T01:00:23+00:00Added an answer on May 20, 2026 at 1:00 am

    ISingleResult inherits IEnumerable

    IEnumerable has an extension method called ToArray.

    Edit sorry, missed that T was a class, not String. So it would be

    ISingleResultValue.Select(x=>x.StringProperty).ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way to do that? I'm tempted to call ffmpeg, but
I am tempted to write something as follows: StringBuilder.append(String.format(%d %f, x, y)); But, I
I'm working my way through Programming in Scala , and though I'm tempted to
I'm tempted to say this problem is with my general architecture but either way
I'm always tempted to extend the Sprite class just so my object can be
I just introduced Spring in a JSF web application, and now I'm feeling tempted
I have a byte array property that must be a certain length. I am
I'm tempted to add a suffix like Ex to differentiate methods (with similar signatures)
I am looking for the cleanest way. I am tempted to use delegates not
The Visual Studio SP1 beta just became available. I'm tempted to give it a

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.