[Newbie Question] Enumerating the values in a OleDb parameter collection?

D

DC

Is there an easy way of Response writing the value contained within each
item in an OleDb parameter collection? Using a For each loop for example?

Thanks in advance,
 
C

ca8msm

Yes, you could use an IEnumerator e.g.

Dim a As New OleDbCommand
Dim b As IEnumerator = a.Parameters.GetEnumerator
While b.MoveNext
'... y.Current gets the current item
End While

Or, you could use the Index of each parameter e.g.

Dim c As New OleDbCommand
For d As Integer = 0 To (c.Parameters.Count - 1)
'... c.Parameters.Item(d) gets the current item
Next
 
S

Steve

How about something like this:

Dim cmd As System.Data.OleDb.OleDbCommand
For Each param As System.Data.OleDb.OleDbParameter In cmd.Parameters
Response.write(param.Value)
Next


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top