OleDbCommand String & Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I set the CommandText of an OleDbCommand and I want to include
parameters that I'll them populate with OleDbCommand.Parameters.Add(), it
looks like I can either use the question mark character (?) or an "@variable"
construction in the CommandText.

But after that, it looks like regardless of whether I use "?" or
"@variable", when I go to do the OleDbCommand.Parameters.Add()s afterward,
the only thing that matters is the *order* in which I call those Add()
functions, NOT the name I give in the first parameter of the Add() function.
Is this right? Isn't that a little... ugly???

Alex
 
Alex,

That is right what you saw, that is OleDB behaviour, with (some) other
providers the parameters can be named.

In OledB you can even leave the parameter blank when adding parameters.

I hope this helps,

Cor
 
Back
Top