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.