Chris,
Actually I should add, when I'm not certain of the return type (from GetRows
for example) I will use Option Strict Off, and assign the return value to an
Object variable, then look at the variable in one of the Watch windows in
the debugger...
Dim rc As Object
rc = rsRow.GetRows(, , "somefield")
Looking at "rc" in the Auto Watch Window for example will identify the type
that GetRows returned...
Hope this helps
Jay
[quoted text, click to view] "Chris Lane" <ChrisLane@discussions.microsoft.com> wrote in message
news:62C17B48-D33F-4FEB-A074-3718F69E8B4A@microsoft.com...
> Thanks that might work.
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
> > Chris,
> > Try something like:
> >
> > > Array = DirectCast(rsRow.GetRows(, , "somefield"), Object(,))
> >
> > The above was syntax checked only, if RecordSet.GetRows does not return
a
> > two dimension array of objects, you will get a runtime error.
> >
> > Hope this helps
> > Jay
> >
> >
> > "Chris Lane" <Chris Lane@discussions.microsoft.com> wrote in message
> > news:E6AB8F90-9013-4D86-BA4E-BA7CA2C8C67F@microsoft.com...
> > >
> > > Hi,
> > >
> > > I upgraded a VB6.0 application that uses the GetRows method to return
a 2
> > dimensional array into a variable of type variant.
> > > In VB.NET the Variant variable is of type object but since it's a two
> > dimensional array I changed it to the following:
> > >
> > > Dim Array (,) as Object
> > >
> > > On this line:
> > > Array = rsRow.GetRows(, , "somefield")
> > > Now Option strict is barking:
> > > Option Strict On disallows implicit conversions from 'System.Object'
to
> > '2-dimensional array of System.Object'.
> > >
> > > Can I type cast this two a two dimesional array?
> > > If not what else can I do?
> > > Since this project is not funded I am trying to avoid converting ado
code
> > to ado.net code but if that is the only solution I will have to.
> > >
> > > Thank You,
> > >
> > > Chris Lane
> > >
> >
> >
> >