|
|
|
start date: Mon, 20 Aug 2007 15:04:28 +0100,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
DC
|
|
2
unknown
|
|
3
Steve
|
|
4
DC
|
[Newbie Question] Enumerating the values in a OleDb parameter collection?
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,
Date:Mon, 20 Aug 2007 15:04:28 +0100
Author:
|
Re: Enumerating the values in a OleDb parameter collection?
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
Date:Mon, 20 Aug 2007 14:10:30 -0000
Author:
|
Re: [Newbie Question] Enumerating the values in a OleDb parameter
collection?
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
DC wrote:
> 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,
Date:Mon, 20 Aug 2007 10:48:53 -0400
Author:
|
Re: [Newbie Question] Enumerating the values in a OleDb parameter
collection?
Cheers Steve, that worked like a charm.
Steve wrote:
> 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
Date:Wed, 22 Aug 2007 12:10:41 +0100
Author:
|
|
|