OleDbParameter Query: Multiple parameters

  • Thread starter Thread starter Steven K
  • Start date Start date
S

Steven K

Hello,

I am calling a SQL Server 2K parameter query with the following:

Dim spWebDocGroup As OleDb.OleDbDataReader
Dim prmWebDocGroup As OleDbParameter
Dim cmdWebDocGroup As New OleDb.OleDbCommand("zsp_web_WebDocument",
cnnSearch)
cmdWebDocGroup.CommandType = CommandType.StoredProcedure
prmWebDocGroup = cmdWebDocGroup.Parameters.Add("@strParm00",
OleDbType.VarChar, 30)
prmWebDocGroup.Value = "FindDocList"

How do you add multiple parameters (@strParm01, @strParm02 ect.) and their
respective values?
 
One other tip:
OLEDB named parameters don't work the way that SQL named parameters do.
The sequence that you create the OLEDB param is what is used! Not the name.
So build them in the sequence you plan to use them!
I lost an hour to that little nuance!
 
Back
Top