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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:04:48+00:00 2026-05-14T07:04:48+00:00

I know I am forgetting to remember how to do this and it is

  • 0

I know I am forgetting to remember how to do this and it is late.

I want to, in an elegant manner, build a placeholder list for a munged sql command.

Have a command with an arbitrary number of parameters, need to build ?,?,?

Did I mention that it was a wet brain fart? this is what came out:

You are welcome to make me feel like more of an idiot if you just remember me what I am forgetting. 😉


Ok, looks like I should be calling it a night.

Both you guys confirmed what I was doing before going off the deep end.

This is my name list,

string names = string.Join(",", _command.Parameters.Cast<SQLiteParameter>().Select(p => p.ParameterName).ToArray());

And I just replaced the p.Name with ‘?’

string vals = string.Join(",", _command.Parameters.Cast<object>().Select(p => "?").ToArray());

But for some reason I did not approve.

Thanks.

  • 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-14T07:04:49+00:00Added an answer on May 14, 2026 at 7:04 am

    Along the lines of @Jon’s answer:

    string.Join(",", _command.Parameters.Cast<object>().Select(p => "?").ToArray())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have several SQL Server 2000 databases (I know, we need to upgrade) that
This is driving me absolutely insane. I know that, to change the formatting of
Know this might be rather basic, but I been trying to figure out how
Say I have a mobile web app written using JQuery Mobile, this app retrieves
I'm trying to convert a byte[] to an image in C#. I know this
I have an interesting encryption problem at hand. I do not know if it
I have uncommented the LDAP and UserMapper connectors in application.xml I know my LDAP
I have this nice little snippet i've made for getting browser position: if (!window.position)
This is something I should know, but I'm drawing a blank on it and
I know there are many tutorials out there for getting started in C. However

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.