DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us