>
This wouldn't work if you use a generic driver like OleDb, no? >
>Hi, Cetin,
>
>Off the top of my head, I'm not sure. I'll try it with both the ole provider, as well as the provider factory in ADO2, and I'll let you know
>
>Kevin
Oh sorry I should give the answer (it was a question with reply in it):
From documentation
"The OLE DB .NET Provider does not support named parameters for passing parameters to an SQL statement or a stored procedure called by an OleDbCommand when CommandType is set to Text."
PS: when commandtype is set to text. With Stored procedures case is nt exactly same but still do not work for all providers.
Update:
"When using parameters with an OleDbCommand or OdbcCommand, the order of the parameters added to the Parameters collection must match the order of the parameters defined in your stored procedure. The .NET Framework Data Provider for OLE DB and .NET Framework Data Provider for ODBC treat parameters in a stored procedure as placeholders and apply parameter values in order. In addition, return value parameters must be the first parameters added to the Parameters collection."
Cetin